1

I'm trying to migrate big project, about 2000 components and I have a lot of packages that not relevant in Vue3, 'Element-UI' for instace.

After upgrade Vue to version 3.1.0-0 and add @vue/compat version 3.1.0-0 and @vue/compiler-sfc version 3.1.0-0, I fix all errors and trying to 'npm run dev', than I saw this error

enter image description here

In addition, I have update vue-loader to version 16.0.0 and changed main.js to this:

enter image description here

My package.json: enter image description here

How can I solve this issue?

4
  • first line import Vue, {createApp} from 'Vue' change to import { createApp } from 'vue' . Commented Dec 6, 2022 at 7:28
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Dec 6, 2022 at 7:58
  • Still.... same error Commented Dec 6, 2022 at 8:32
  • Images are forbidden here, please post those as actual (highlighted) text. Otherwise, you can follow the official guide: v3-migration.vuejs.org Maybe upgrade towards the latest version of Vue too. Commented Dec 6, 2022 at 10:21

1 Answer 1

1

This question ranks high in google, so I would add a settings for Vue 3. With Webpack 5 and Vue 3, the webpack config alias changes to this:

resolve: {
extensions: [ '.tsx', '.ts', '.js', '.vue' ],
alias: {
    'vue': '@vue/runtime-dom'
}

},

Alternatively this may be the solution, if the are transpilation errors:

  alias: {
    'Vue': 'vue/dist/vue.esm-bundler.js',
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.