Home > Back-end >  mismatch vue js 3 nuxt js with vue-server-renderer
mismatch vue js 3 nuxt js with vue-server-renderer

Time:01-01

I am trying to npm run dev my nuxt js vue3 project. And I get error: enter image description here

My package.json:

{
  "name": "my-project",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate"
  },
  "dependencies": {
    "core-js": "^3.25.3",
    "nuxt": "^2.15.8",
    "vue": "^3.0.0-rc.8",
    "vue-server-renderer": "^2.7.14",
    "vue-template-compiler": "^2.7.10"
  },
  "devDependencies": {
    "node-sass": "^8.0.0",
    "sass-loader": "^13.2.0"
  }
}

How make it work in compatibility?

CodePudding user response:

You should probably replace

vue-server-renderer vue-template-compiler

by

@vue/compiler-sfc @vue/server-renderer

Also, I'm not sure why you're using an RC version for Vue3, use the latest aka v3.2.45 at the time of writing.

As for Nuxt, Nuxt2 is aimed towards usage with Vue2.
Nuxt's latest stable version for Vue3 is v3.0.0.


At that point, if you are starting a new project, consider using the CLI for such a purpose (don't forget to respect the prerequisites).

  • Related