Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

await router.isReady() gets blocked #434

Open
heriec opened this issue Dec 20, 2024 · 0 comments
Open

await router.isReady() gets blocked #434

heriec opened this issue Dec 20, 2024 · 0 comments

Comments

@heriec
Copy link

heriec commented Dec 20, 2024

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);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant