-
-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
When I build, await router.isReady()
gets blocked indefinitely. To reproduce this issue, I added this line of code in my main.ts
, which indeed caused the subsequent code to be blocked, leaving a blank page in the browser.
Then, I found that my router does not block await router.isReady()
when not using vite-ssg
before.
Therefore, it might indicate where the problem lies? I have debugged this issue with await router.isReady()
for a long time and even looked at many related issues but found no solution.
main.ts
import { ViteSSG } from 'vite-ssg';
import App from './App.vue';
import { routes} from '@/router';
//css
import '@/styles/index.scss';
import 'element-plus/dist/index.css';
import { loadSvg } from '@/icons';
import { setupPinia } from './store';
export const createApp = ViteSSG(App, { routes }, async (ctx) => {
loadSvg(ctx.app);
await ctx.router.isReady();
setupPinia(ctx);
});
Metadata
Metadata
Assignees
Labels
No labels