Cannot read property 'styles' of undefined
See original GitHub issueVersion
17.0.0
Reproduction link
Steps to reproduce
I wanted to create a vue project with webpack.
I installed vue@2, version was 2.7.0, but I installed the lastest vue-loader, version was 17.0.0.
Then I ran webpack-dev-server --mode development
, I got an error:
ERROR in ./src/App.vue
Module build failed (from ./node_modules/vue-loader/dist/index.js):
TypeError: Cannot read property 'styles' of undefined
at Object.loader (/Users/admin/xxx/node_modules/vue-loader/dist/index.js:70:34)
@ ./src/main.js 2:0-28 6:17-20
Is it vue@2 cannot be used with vue-loader@17?
What is actually happening?
My project ran failed.
Thanks~
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Cannot read property 'style' of undefined -- Uncaught Type Error
This works when I try it here: jsfiddle.net/du2ot93e - I think your if statement is failing. · Do you reach the if statement?...
Read more >Cannot read property 'style' of Undefined in JavaScript
To solve the "Cannot read property 'style' of undefined" error, make sure that the value on which you're accessing the style property is...
Read more >TypeError: Cannot set property 'styles' of undefined #222
I actually updated my single page to say import mystyles but I am still getting a message that TypeError: Cannot set property 'styles'...
Read more >TypeError: Cannot read property 'style' of undefined function ...
This error is caused by the client script where the code says: getSectionByName("Release");. The View selected does not have a section "Release" where...
Read more >How To Fix Cannot Read Property 'style' of Null in JavaScript
This error boils down to one problem. The element you are trying to access does not exist in the DOM (document object model)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@candisecandise I managed to get vue 2.7.0 to work with vue-loader 15.10.0 🎉 I also no longer have explicit dependency on vue-template-compiler in my package.json fwiw
upon closer inspection of the 2.7.0 upgrade guide, I see it explicitly says to use 15.10.0 It might be useful to post somewhere on vue-loader docs that 16 and 17 are for vue 3 if that’s the case
@bpossolo Thank you so much! You are really attentive~, I didn’t think to check the upgrade guide for 2.7.0 at all… May i ask where did you find it? I still couldn’t find it… But as you said, the readme of vue-loader should add some instructions, only vue 3 can support 16 and 17@yyx990803