-
Notifications
You must be signed in to change notification settings - Fork 406
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
Error - Window is not defined #1207
Comments
The error is correct - the code is meant to fully execute in a browser environment, not on a server. |
I am running in react environment. but also reported such an error |
Any browser has "browser" defined.
The output would be similar to this - This means that if you get this error, your script is not executing in the browser context. In that case, it won't work - So if you use |
This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
find same issues about this error ( #1179 , #1101 ).
I can't build next.js proejct and can't refresh page in dev server, but found a solution using dynamic import.
This error is because window object is not defined in non-browser environments.
extension/packages/extension-dapp/src/bundle.ts
Line 16 in 895f6a7
Using globlaThis instead of a window object did not cause the same error.
After the fix, the error no longer occurred in my environment. ( next.js 13.1.6 )
The text was updated successfully, but these errors were encountered: