-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Updating from vite 4.1.4 to 4.2.0 broke my build - "Internal server error: window is not defined" #12483
Comments
Related to #12324. The package |
Yeah. The error has always been there, but Vite was incorrectly suppressing it before, which is fixed in Vite 4.2. I'd suggest following fi3ework's solution since I don't think we want to fix this now. |
Hi @fi3ework, the code is already in a client side only block but I think it's already failing on the import. I will take another look if imports can somehow moved to client side only code. Edit: |
@bluwy Might be worth a note/warning in the release notes? This took me by surprise and much longer than I would have liked since there was no information to go by. |
It is noted at vite/packages/vite/CHANGELOG.md Line 78 in f997882
|
That's not sufficient imo. Could be more explicit. I'm probably not the only one this will effect. |
Describe the bug
My app is a Svelte app which is build as static page. After the update from 4.1.4 to 4.2.0 the build is broken.
The release notes of 4.2.0 do not seem to contain any migration guide. Which suggest to me that this update breaking anything is not expected?
Reproduction
https://github.com/bcked/bcked.com/tree/981359b70c2a64e965408ba9f16908812be10a7b
Steps to reproduce
npm run dev
-> this should worknpm update --save vite
npm run dev
-> this now fails with the below exceptionSystem Info
Used Package Manager
npm
Logs
After only performing this update (not other package was updated), suddenly my build throws the following error.
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: