rebass: "Cannot read property 'rules' of undefined" after upgrading to styled components v4

Seems 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)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Just published v2.3.0 which might work with SC v4 if you wanna test it out

2.3.0 resolved the error 😃 I did get a warning after updating. Running npm dedupe resolved the duplicate instances warning.