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

See original GitHub issue

Problem statement

Seems like theme is undefined. This is the error received when trying to use the component:

Screen Shot 2022-05-24 at 3 08 12 PM
<CopyBlock
    text={...}
    language={"typescript"}
    theme={dracula}
    showLineNumbers
    codeBlock
/>

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
OlivierArgentiericommented, May 30, 2022

Same problem here

0reactions
songhanpoocommented, Sep 25, 2022

same. does anyone know do we need to provide any package for default scenario ? i saw we need to require to set attribute theme . and we can import list them from “react-code-blocks” and choose it into list from demo site.

import { CopyBlock,atomOneDark } from "react-code-blocks";

<CopyBlock
    text={value.rich_text[0].plain_text}
    language={value.language}
    showLineNumbers={true}
    theme={atomOneDark}
    wrapLines
  />
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error "Cannot read property 'color' of undefined" - Stack Overflow
To just make it work in your case, try this (note that the ThemeProvider should really be located at the top-level of your...
Read more >
Uncaught TypeError: Cannot read property 'color' of undefined ...
The Legend doesn't get rendered and the console shows: Uncaught TypeError: Cannot read property 'color' of undefined styler.js:145.
Read more >
Error: Cannot read property 'TextColor' of undefined.
I get this error when an enemy attack me and is tryign to apply a State (Posion to be exact) I am using...
Read more >
color - \textcolor is not working - TeX - LaTeX Stack Exchange
Package xcolor Error: Undefined color `BLUE'. I have done some research and added the package xcolor with some arguments \usepackage{xcolor} \ ...
Read more >
Cannot set property 'color' of Undefined in JavaScript
The error most commonly occurs when trying to set the color of a DOM element after using the getElementsByClassName method.
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