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
When importing Vue, it should be the same as when Vue is required.
What is actually happening?
Vue is different when imported than when using require.
In 2.7, the exports field is used in package.json to export a different version of Vue depending on whether Vue is imported or required. This is a breaking change when compared to 2.6 because here the exports field is not used and hence you always get the commonjs version. This can be problematic for example when using @vue/test-utils or vue-template-compiler because those use require to import vue (which led me to open this issue).
As per the dual package hazard, I think it would be better to use an esm wrapper, where vue.runtime.mjs does something like
Version
2.7.3
Reproduction link
github.com
Steps to reproduce
What is expected?
When importing Vue, it should be the same as when Vue is required.
What is actually happening?
Vue is different when imported than when using
require
.In 2.7, the
exports
field is used in package.json to export a different version of Vue depending on whether Vue is imported or required. This is a breaking change when compared to 2.6 because here theexports
field is not used and hence you always get the commonjs version. This can be problematic for example when using @vue/test-utils or vue-template-compiler because those use require to import vue (which led me to open this issue).As per the dual package hazard, I think it would be better to use an esm wrapper, where
vue.runtime.mjs
does something likeThe text was updated successfully, but these errors were encountered: