JedWatson / JedWatson/react-select
ReferenceError: 'window' is not defined at... var globalContext = isBrowser ? window : global;
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
Very simple. I can this error ReferenceError: 'window' is not defined at line:
var globalContext = isBrowser ? window : global
window object does not exist on server so error is thrown.
Rendering on client works fine!
Are you reporting a bug or runtime error?
Runtime error
I cannot use codepen! Problem is when rendering on server!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the reported line, var globalContext = isBrowser ? window : global, and trace how it is reached during server rendering. Reproduce the error in a server-rendering setup, then verify that the issue no longer raises ReferenceError: 'window' is not defined while client rendering continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100