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 'backgroundColor' of undefined

See original GitHub issue

Cloning this repository, and running install, build and start command, I get the following error as soon as I visit the dashboard with my browser.

(pi@HulenPi:~/dashboard/pages $ npm start

> dashboard@1.0.0 start /home/pi/dashboard
> next start

> Ready on http://localhost:3000
TypeError: Cannot read property 'backgroundColor' of undefined
    at /home/pi/dashboard/.next/server/static/mX9Kv1iErUfmWQOdMcvjO/pages/index.js:363:30
    at flatten (/home/pi/dashboard/node_modules/styled-components/dist/styled-components.cjs.js:1292:21)
    at flatten (/home/pi/dashboard/node_modules/styled-components/dist/styled-components.cjs.js:1272:16)
    at ComponentStyle.generateAndInjectStyles (/home/pi/dashboard/node_modules/styled-components/dist/styled-components.cjs.js:1481:19)
    at StyledComponent.generateAndInjectStyles (/home/pi/dashboard/node_modules/styled-components/dist/styled-components.cjs.js:2160:36)
    at StyledComponent.renderInner (/home/pi/dashboard/node_modules/styled-components/dist/styled-components.cjs.js:2065:33)
    at a.render (/home/pi/dashboard/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:64)
    at a.read (/home/pi/dashboard/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:58)
    at renderToString (/home/pi/dashboard/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:53:83)
    at render (/home/pi/dashboard/node_modules/next-server/dist/server/render.js:86:16))

When running “npm run dev” then everything works fine.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
danielbayerleincommented, Jul 21, 2019

@yatong-moto Thank you for the feedback! Fixed with 084dfdb237db02f37b17c5c060be29a794729a76

1reaction
marco-strengcommented, May 30, 2019

Seems to be fixed in Next.js v8.1.1-canary.40

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript - Cannot set property 'backgroundColor'
I'm trying to make a website, but I'm having a problem. When I run it in Chrome I get: "Cannot set property 'backgroundColor'...
Read more >
Cannot set properties of undefined (setting 'color') in JS
The "Cannot set property 'color' of undefined" error occurs when setting the color property on an undefined value. To solve the error, check...
Read more >
Cannot set property 'color' of undefined at script.js:22 (Example)
Uncaught TypeError : Cannot set property 'color' of undefined at script.js:22. const myTag=document.getElementsByClassName('wrong-error'); ...
Read more >
Cannot set property 'backgroundColor' of undefined · Issue #66
Uncaught TypeError : Cannot set property 'backgroundColor' of undefined in jquery.color.js:576 jQuery version is above 1.4 Other work fine.
Read more >
Uncaught TypeError : Cannot read properties of undefined
Looking for ways to handle Uncaught TypeError: Cannot read property of undefined in JavaScript? This guide will help you to catch errors.
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