最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

vuejs3 - After upgrading to Vue 3.2 project doesn't compile anymore - Stack Overflow

programmeradmin2浏览0评论

So I updated all my stuff from Vue2 to Vue3 and now I'm seeing this...

ERROR  Failed to compile with 1 error                                                                                                          5:59:31 PM

 error  in ./src/App.vue

Syntax Error: TypeError: Cannot read properties of undefined (reading 'styles')


ERROR in ./src/App.vue
Module build failed (from ./node_modules/vue-loader/dist/index.js):
TypeError: Cannot read properties of undefined (reading 'styles')
    at Object.loader (/Users/xx/Desktop/Clients/xx/mi/node_modules/vue-loader/dist/index.js:96:34)
 @ ./src/main.js 2:0-27 23:17-20

ERROR in ./src/views/About.vue
Module build failed (from ./node_modules/vue-loader/dist/index.js):
TypeError: Cannot read properties of undefined (reading 'styles')
    at Object.loader (/Users/xx/Desktop/Clients/xx/mi/node_modules/vue-loader/dist/index.js:96:34)
 @ ./src/router/index.js 23:21-81
 @ ./src/main.js 4:0-29 21:2-8

ERROR in ./src/views/Home.vue
Module build failed (from ./node_modules/vue-loader/dist/index.js):
TypeError: Cannot read properties of undefined (reading 'styles')
    at Object.loader (/Users/xx/Desktop/Clients/xx/mi/node_modules/vue-loader/dist/index.js:96:34)
 @ ./src/router/index.js 3:0-36 14:15-19
 @ ./src/main.js 4:0-29 21:2-8

webpack compiled with 3 errors

my NPM

[email protected] /Users/xx/Desktop/Clients/xx/mi
├── @vue/[email protected]
├── @vue/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

my NPM -g

├── @angular/[email protected]
├── @vue/[email protected]
├── @vue/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

So I updated all my stuff from Vue2 to Vue3 and now I'm seeing this...

ERROR  Failed to compile with 1 error                                                                                                          5:59:31 PM

 error  in ./src/App.vue

Syntax Error: TypeError: Cannot read properties of undefined (reading 'styles')


ERROR in ./src/App.vue
Module build failed (from ./node_modules/vue-loader/dist/index.js):
TypeError: Cannot read properties of undefined (reading 'styles')
    at Object.loader (/Users/xx/Desktop/Clients/xx/mi/node_modules/vue-loader/dist/index.js:96:34)
 @ ./src/main.js 2:0-27 23:17-20

ERROR in ./src/views/About.vue
Module build failed (from ./node_modules/vue-loader/dist/index.js):
TypeError: Cannot read properties of undefined (reading 'styles')
    at Object.loader (/Users/xx/Desktop/Clients/xx/mi/node_modules/vue-loader/dist/index.js:96:34)
 @ ./src/router/index.js 23:21-81
 @ ./src/main.js 4:0-29 21:2-8

ERROR in ./src/views/Home.vue
Module build failed (from ./node_modules/vue-loader/dist/index.js):
TypeError: Cannot read properties of undefined (reading 'styles')
    at Object.loader (/Users/xx/Desktop/Clients/xx/mi/node_modules/vue-loader/dist/index.js:96:34)
 @ ./src/router/index.js 3:0-36 14:15-19
 @ ./src/main.js 4:0-29 21:2-8

webpack compiled with 3 errors

my NPM

[email protected] /Users/xx/Desktop/Clients/xx/mi
├── @vue/[email protected]
├── @vue/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

my NPM -g

├── @angular/[email protected]
├── @vue/[email protected]
├── @vue/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
Share Improve this question asked 16 hours ago BostonAreaHumanBostonAreaHuman 1,4612 gold badges21 silver badges44 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

It's your use of vue-template-compiler, it needs to be replaced, as stated in the Vue migration guide

In package.json ... replace vue-template-compiler (if present) with @vue/compiler-sfc

Be sure to read and follow the entire guide to avoid issues during the migration process!

发布评论

评论列表(0)

  1. 暂无评论