Assets (Images/MDI Icons) loaded from wrong origin when microfrontend is integrated with Qiankun #3047
Unanswered
rafaelmmedeiros
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Assets (Images/MDI Icons) loaded from wrong origin when microfrontend is integrated with Qiankun
Description:
I'm developing a Vue 3 microfrontend with Vite and integrating it into Qiankun using vite-plugin-qiankun. When running standalone, my images and MDI icons load correctly. However, when the microfrontend is loaded via the Qiankun orchestrator, the assets are requested from the orchestrator's origin (e.g., http://localhost:5173/) instead of the microfrontend’s origin (e.g., http://localhost:5174/), resulting in 404 errors and missing icons.
I have tried several approaches:
Setting the base option in vite.config.ts (using both relative and absolute URLs).
Using the postcss-url plugin to rewrite URLs for fonts and images.
Moving assets to the public/ directory and referencing them with absolute paths.
Ensuring local import of @mdi/font in the Vuetify plugin.
None of these solutions have resolved the issue. Has anyone encountered this problem or can suggest how to force asset requests to be made to the microfrontend’s origin when running under Qiankun?
---- vite.config.ts on vue3 app.
---- main.ts on Qiankun Orquestrator:
---- vite.config.ts on Qiankun Orquestrator:
Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions