Search code examples
javascriptnpmvuejs3typescript-typingspinia

"hasInjectionContext" is not exported by "node_modules/vue-demi/lib/index.mjs", imported by "node_modules/pinia/dist/pinia.mjs"


When I start my programe,console print "hasInjectionContext" is not exported by "node_modules/vue-demi/lib/index.mjs", imported by "node_modules/pinia/dist/pinia.mjs". at ../node_modules/pinia/dist/pinia.mjs:6:9.

I try to remove node_module and change pinia version to 2.0.36.But it doesn't work. How should I change? By the way , I stickUp Another node_module which pinia version is 2.0.36 also doesn't work.


Solution

  • I solve this problem by changing vue version to ^3.3.0.Seeing it is working properly now after changing version. you can try this solution.

    {
     "pinia": "^2.1.3",
     "sass": "^1.60.0",
     "sass-loader": "^13.2.2",
     "vue": "^3.3.0",
     "vue-cookies": "^1.8.3",
    }