Frontend blank-screens on load with uncaught TypeError: Gr is not a function at index.ts:116:12. Gr is the minified name for createWebHistory.
Root cause: Rolldown (Vite 8's bundler) splits vue-router exports into the index-*.js chunk while the router module lands in router-*.js. This creates a circular import — when router-*.js evaluates, createWebHistory hasn't been initialized yet in the sibling chunk.
Fix: Convert the top-level createRouter() call to a deferred factory function so vue-router symbols are only invoked after all modules have finished loading.
// before — executes during module evaluation, before createWebHistory is live
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL), // 💥 Gr is not a function
routes,
})
export default router
// after — deferred until main.ts calls it
export function createAppRouter() {
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes,
})
// ...beforeEach guard...
return router
}fe/src/router/index.ts— replace top-level router creation withcreateAppRouter()factory; addgetRouter()accessor for the cached instancefe/src/main.ts— callcreateAppRouter()at startup instead of importing default exportfe/src/stores/auth.ts— usegetRouter()instead ofrouterModule.defaultfor lazy router accessfe/src/__tests__/auth.store.spec.ts— update import to match new API
Automated Canary build