module
parameter must have all Vue-related entries in the import map loaded from unpkg:
Transforms all “bare” import specifiers in JavaScript modules to unpkg URLs. This functionality is highly experimental.
This issue persists in this playground and leads to multiple instances of the vue
library being loaded by @vueuse/core?
from unpkg:
"imports": {
"vue": "https://play.vuejs.org/vue.runtime.esm-browser.js",
"vue/server-renderer": "https://play.vuejs.org/server-renderer.esm-browser.js",
"@vueuse/core": "https://www.unpkg.com/@vueuse/core?module"
},
Having multiple copies of Vue can lead to loss of reactivity.
To address this, either update vue
, etc to use unpkg, or avoid using ?module
and properly add the dependency tree to the import map (see demo):
"imports": {
"vue": "https://play.vuejs.org/vue.runtime.esm-browser.js",
"vue/server-renderer": "https://play.vuejs.org/server-renderer.esm-browser.js",
"@vueuse/core": "https://www.unpkg.com/@vueuse/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fa9995889fbacbcad4c3d4ca">[email protected]</a>/index.mjs",
"@vueuse/shared": "https://www.unpkg.com/@vueuse/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cebda6afbcabaa8efffee0f7e0fe">[email protected]</a>/index.mjs",
"vue-demi": "https://www.unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f5838090d89190989cb5c5dbc4c1dbc2">[email protected]</a>/lib/index.mjs"
},