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.

Error: self is not defined

See original GitHub issue

First of all, thanks for creating this amazing color library.

Issue

I am using NextJS v10.0.0 with some custom _document.tsx and I found this error on the server-side. The usage is pretty simple:

function Page() {
  const [bgColor, setBgColor] = React.useState(new Color(blue[100]));
  const backgroundColor = bgColor.toString() // crash!
  return (...)
}

image

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
LeaVeroucommented, Jun 16, 2022

I think this must be fixed with the new release since it was related to #134, if not please reopen.

1reaction
LeaVeroucommented, Jun 3, 2022

Happy to merge PRs using globalThis instead of self

Read more comments on GitHub >

github_iconTop Results From Across the Web

python global name 'self' is not defined - Stack Overflow
self is the self-reference in a Class. Your code is not in a class, you only have functions defined. You have to wrap...
Read more >
Python NameError: name 'self' is not defined - Softhints
Common errors for beginners related to self in Python is: NameError: name 'self' is not defined The keyword self is a special one...
Read more >
NameError: name 'self' is not defined in Python [Solved]
To solve the NameError: name 'self' is not defined, make sure you haven't forgotten to specify the `self` argument in a method and...
Read more >
NameError: name 'self' is not defined : r/learnpython - Reddit
I have the following python code but it gives me the error in the title: "NameError: name 'self' is not defined" class foo:...
Read more >
NameError: name 'self' is not defined - BayesFusion Support
You are trying to run modified Tutorial1 code - in that code self refers to object of Tutorial1 class. Try to remove all...
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