-
-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
globalThis is not defined #10910
Comments
Is there any workaround before release? |
I provided a workaround: Use |
Hi. What about TypeScript? I try |
declare global {
interface Window {
myAwesomeGlobalVar: YourType
}
} The best solution is to import your variables if you can... |
fixed with general dependency updates in create-react-app v5 |
"duplicate?": Probably because of #10636
Describe the bug
When I use
globalThis
I get the following error:Did you try recovering your dependencies?
Which terms did you search for in User Guide?
I searched
globalThis
. While typing it was onglobal
and the autocomplete suggestions included this: https://create-react-app.dev/docs/using-global-variables/which provides a workaround: Use
window
instead. However i'd rather useglobalThis
anyways.Environment
(paste the output of the command here.)
Steps to reproduce
(Write your steps here:)
globalThis
Expected behavior
(Write what you thought would happen.)
It would work
Actual behavior
(Write what happened. Please add screenshots!)
Reproducible demo
untested demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered: