Skip to content

In the production environment, the ui lib feature is not working #101

@superglg738

Description

@superglg738

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions