You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Webpack, listing vue as an external library (loaded separately in the browser), produces a bundle that checks the module for __esModule (which is true on the Vue global build, as well as VueRouter, but not Vuex), but when this value is true it then expects default to be defined on the module, which is undefined.
What is expected?
import Vue from 'vue'; should work. Vue.default in the browser should return Vue, or Vue.__esModule should not be defined.
What is actually happening?
Vue.__esModule is true but Vue.default is undefined, so import Vue from 'vue'; returns undefined in my client code.
I am trying to load as much as possible from CDN; so I don't want to import Vue directly into my bundle. The current build forces me to write const Vue = window.Vue;.
The text was updated successfully, but these errors were encountered:
No. Vue 3 has no default export. You have to do named imports when using ES module syntax. that's regardless of the build version you are using - that's kind of the point.
Version
3.2.30
Reproduction link
stackoverflow.com
Steps to reproduce
Webpack, listing vue as an external library (loaded separately in the browser), produces a bundle that checks the module for
__esModule
(which is true on the Vue global build, as well as VueRouter, but not Vuex), but when this value is true it then expectsdefault
to be defined on the module, which is undefined.What is expected?
import Vue from 'vue';
should work.Vue.default
in the browser should return Vue, orVue.__esModule
should not be defined.What is actually happening?
Vue.__esModule
is true butVue.default
is undefined, soimport Vue from 'vue';
returns undefined in my client code.I am trying to load as much as possible from CDN; so I don't want to import Vue directly into my bundle. The current build forces me to write
const Vue = window.Vue;
.The text was updated successfully, but these errors were encountered: