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
loading vue3 js library via importmap crashes during load #731
Comments
This is weird, I have been doing some investigation: If I set vue to be compiled into my ufrontend (ie omit it from webpack externals), and change my App.vue to this:
Then I see the following in the console:
and things work ok (although my GUI isn't rendered obviously) If I change vue to be a webpack external, then I see this in the console:
ie in that mode, h and createApp are undefined! I can see its loading the vue.global.js ok (log in console and checked in network tab) So, with vue3 as an external, webpack or something is not returning resolved vue exports properly? |
This is a duplicate of #672 and is explained in detail in systemjs/systemjs#2272. See systemjs/systemjs#2272 (comment) for the best way to load Vue 3 as a systemjs module. |
Thanks! However, I found another related issue so I created a ticket in systemjs for it: systemjs/systemjs#2300 |
Describe the bug or question
If I build a vue3 micro frontend with embedded vue3 library it works. If I change webpack config to
Using this as the vue3 library in the importmap:
Then I get the following javascript error at runtime when single-spa tries to load the vue3 micro frontend:
This appears to be from the guts of webpack, which I do not yet know.
I assume vue.global.js is the file to use for vue 3; I tried all the others and they appear to work even less.
In summary:
vue2 works fine
vue3 built into the micro frontend app works fine (ie not via importmap).
vue3 as external library loaded via importmap breaks as above.
I'm using:
vue: 3.0.5
single-spa: 5.9.1
I am not using single-spa-layout
I created the vue micro frontend + root-config from scratch app using your own tooling (after I figured out this other bug: https://github.com/single-spa/single-spa-vue/issues/71).
I can supply an example if that would help.
The text was updated successfully, but these errors were encountered: