vuejs / pinia

🍍 Intuitive, type safe, light and flexible Store for Vue using the composition api with DevTools support
https://pinia.vuejs.org
MIT License
12.72k stars 996 forks source link

Using Pinia app crashes with Error: The requested module 'vue-demi' does not provide an export named 'hasInjectionContext' #2627

Closed marcodarko closed 3 months ago

marcodarko commented 3 months ago

Reproduction

https://pinia.vuejs.org/ssr/nuxt.html

Steps to reproduce the bug

Similar issues online say it's a pinia version thing but nothing works. Started experiencing this whole migrating from Vuex to Pinia following: https://pinia.vuejs.org/ssr/nuxt.html

Expected behavior

pinia to work with Nuxt3 seamlessly

Actual behavior

App crashes and cannot get the server to start.

Additional information

{
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare",
    "format": "prettier .  --write"
  },
  "overrides": {
    "vue": "latest"
  },
  "devDependencies": {
    "nuxt": "^3.0.0-rc.14",
    "prettier": "^2.7.1"
  },
  "dependencies": {
    "@codemirror/autocomplete": "github:codemirror/autocomplete",
    "@codemirror/lang-json": "github:codemirror/lang-json",
    "@codemirror/view": "github:codemirror/view",
    "@fortawesome/fontawesome-svg-core": "^6.2.0",
    "@fortawesome/free-brands-svg-icons": "^6.1.2",
    "@fortawesome/free-regular-svg-icons": "^6.1.2",
    "@fortawesome/free-solid-svg-icons": "^6.1.2",
    "@fortawesome/vue-fontawesome": "^3.0.1",
    "@pinia/nuxt": "^0.5.1",
    "ajv": "^8.11.0",
    "ajv-formats": "^2.1.1",
    "axios": "^0.21.4",
    "chart.js": "^3.9.1",
    "clipboard": "^2.0.11",
    "codemirror": "^6.0.1",
    "cytoscape": "^3.22.1",
    "cytoscape-dagre": "^2.4.0",
    "lodash": "^4.17.21",
    "mark.js": "^8.11.1",
    "moment": "^2.29.4",
    "papaparse": "^5.3.2",
    "pinia": "^2.1.7",
    "showdown": "^2.1.0",
    "simple-notify": "^0.5.5",
    "sweetalert2": "^11.4.33",
    "tabulator-tables": "^5.3.2",
    "tippy.js": "^6.3.7",
    "vue-gtag-next": "^1.14.0",
    "vue-router": "^4.1.2",
    "vue-sweetalert2": "^5.0.5"
  }
}