-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Not sure how to debug "window is not defined" during prerender #151
Comments
Our error positioning was a bit broken up to #149 unfortunately. I won't be able to take a look until later but it's something you could start with if you desired. Alternatively, the file is written to disk; upon erroring, you could open the file path and debug the built file, though it's a bit rough doing this as it is of course minified by Vite. Edit (doing this from my phone): this is a likely candidate to check: https://github.com/flpvsk/log-into-earth/blob/580a5a2866d1b00512e0505535c21c4414cb8ac6/src/hooks/useUserInfo.ts#L52 |
Thanks! The window reference you found was indeed the one :/ But now I'm seeing In any case, not sure if having this issue is valuable, if you are already working on improving the stack trace of that error. Please feel free to close it if it's not! |
Your redirect methods might be problematic, will take a look. I'll try to get a release out later, I do fully understand it's miserable to debug stuff at the moment. Sorry. Your issue is totally fine though, in lieu of decent error messages the least I can do is help out myself :) |
Looking at your issue, (which I see you've "fixed" by wrapping We could probably use some docs in |
At some point working on a project pre-render stopped working with "window not defined" error. I'm guessing it is because of one of the libraries, but I have no idea how to find which one and where to patch it.
Repo and branch with reproduction: https://github.com/flpvsk/log-into-earth/tree/bug/prerender-broken
Stack trace
package-lock.json: https://gist.github.com/flpvsk/165972441d5c09fa026ff143233a2568
The text was updated successfully, but these errors were encountered: