"Cannot read property 'rules' of undefined" after upgrading to styled components v4
See original GitHub issueSeems System.js will generate a styled component without a ‘componentStyle’ attribute in some cases. Having a tough time putting my finger on what could be the solution.
styled-components.browser.esm.js:1736 Uncaught TypeError: Cannot read property 'rules' of undefined
at createStyledComponent (styled-components.browser.esm.js:1736)
at templateFunction (styled-components.browser.esm.js:1971)
at eval (index.js:32)
at System.create (System.js:117)
at eval (Box.js:17)
at Object../node_modules/grid-styled/dist/Box.js (commons.js:2940)
at __webpack_require__ (commons.js:725)
at fn (commons.js:102)
at eval (index.js:7)
at Object../node_modules/grid-styled/dist/index.js (commons.js:2964)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:15 (7 by maintainers)
Top Results From Across the Web
"Cannot read property 'rules' of undefined" after upgrading to styled ...
Seems System.js will generate a styled component without a 'componentStyle' attribute in some cases. Having a tough time putting my finger on what...
Read more >Styled Component in React: TypeError: Cannot read property ...
1 Answer 1 ; import React · Component · from ; 'react' · import · Button · from ; 'react-bootstrap' · import ·...
Read more >cannot read properties of undefined (reading 'displayname ...
Apparently, I was importing a Navbar, my component's name is Header. Also there is a difference between export default function () {} and...
Read more >Upgrading styled-components from v3 to v4 - Formidable Labs
The v4 release of styled-components comes with a lot of features and ... We got "Cannot read property path of undefined" because the...
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
Just published
v2.3.0
which might work with SC v4 if you wanna test it out2.3.0 resolved the error 😃 I did get a warning after updating. Running
npm dedupe
resolved the duplicate instances warning.