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
I got error Can't import the named export from non EcmaScript module (only default export is available) while using Pinia in Vue 2.
Steps to reproduce the behavior
Use vue-cli to create a vue 2 app.
Run yarn add pinia @vue/composition-api
Edit the main.js
import Vue from "vue";
import { createPinia, PiniaVuePlugin } from "pinia";
Vue.use(PiniaVuePlugin);
const pinia = createPinia();
new Vue({
render: (h) => h(App),
el: "#app",
pinia,
});
Run yarn serve
Expected behavior
The vue 2 app run without Can't import the named export from non EcmaScript module (only default export is available) error.
Actual behavior
ERROR Failed to compile with 19 errors 22:11:24
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'computed' from non EcmaScript module (only default export is
available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'del' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'effectScope' from non EcmaScript module (only default export
is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'getCurrentInstance' from non EcmaScript module (only default
export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'inject' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'isReactive' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'isRef' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'isVue2' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'markRaw' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'nextTick' from non EcmaScript module (only default export is
available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'onUnmounted' from non EcmaScript module (only default export
is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'reactive' from non EcmaScript module (only default export is
available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'ref' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'set' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'toRaw' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'toRef' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'toRefs' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'unref' from non EcmaScript module (only default export is available)
error in ./node_modules/pinia/dist/pinia.mjs
Can't import the named export 'watch' from non EcmaScript module (only default export is available)
Reproduction
I got error
Can't import the named export from non EcmaScript module (only default export is available)
while using Pinia in Vue 2.Steps to reproduce the behavior
yarn add pinia @vue/composition-api
main.js
yarn serve
Expected behavior
The vue 2 app run without
Can't import the named export from non EcmaScript module (only default export is available)
error.Actual behavior
Additional information
The text was updated successfully, but these errors were encountered: