question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'styles' of undefined

See original GitHub issue

Version

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:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

4reactions
bpossolocommented, Jul 4, 2022

@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

1reaction
candisecandisecommented, Jul 13, 2022

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found