Open
Description
The hash is generated in this line of code:
Line 142 in 8357e07
This hash is generated using the relative path of the file being considered. But, in a microfrontend architecture, eg: when using single-spa. Different parcels and applications, if loaded at the same time may be built using different webpack configs, but use the same Vue
instance. This is causing duplicate hashes being registered to the same Vue instance, since the relative path remains the same (eg: parcel1/src/App.vue
, app1/src/App.vue
, parcel2/src/App.vue` all will have the same HMR id)
This is causing issues like:
- app1's
App.vue
gets mounted by callingcreateApp().mount
- app1 now tries to mount parcel1 dynamically, by importing it's
main.js
(this file then will call thecreateApp().mount
with parcel1'sApp.vue
) - on import, Vue's HMR thinks that parcel1's
App.vue
is the same as app1'sApp.vue
. - parcel1's
App.vue
gets mounted in place of app1'sApp.vue
In the above scenario, createApp().mount was never called with parcel1's App.vue, and still it gets mounted
Possible solutions:
- use the absolute path of the file being considered, by just replacing
path.relative
withpath.resolve
, since generally the absolute paths of different microfrontends are different (are located in different folders) - give users an option to give a suffix/prefix to the string that is used to create the hash
Metadata
Metadata
Assignees
Labels
No labels