-
Notifications
You must be signed in to change notification settings - Fork 76
Description
Describe the bug
throws an error:
TypeError: Failed to fetch dynamically imported module: xxxxxx/c-alert/c-alert.demo.vue
This issue only occurs in production, while it works fine in development.
In the production environment, the c-lib feature is not working and throws an error:
TypeError: Failed to fetch dynamically imported module: xxxxxx/c-alert/c-alert.demo.vue
What happened?
This issue only occurs in production, while it works fine in development.
In the original CorentinTh/it-tools code, UI routes are only generated in development.
I modified the routing logic to force-generate these routes in production, but the Vue components still fail to load.
The problem likely stems from:
const demoPages = import.meta.glob('..//.demo.vue', { eager: true });
This dynamic import works in dev (thanks to Vite’s HMR) but fails in production because .vue files are compiled into .js chunks.
System information
window 11
Where did you encounter the bug?
Public app (sharevb-it-tools.vercel.app)