-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix(next): do not override process.env #12125
Conversation
🦋 Changeset detectedLatest commit: 0bb259d The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a major
changeset. A reviewer will merge this at the next release if approved.
Linking back to a Vite issue that also describes this problem that has recent activity: vitejs/vite#17689 |
I just realized something, why does Cloudflare sets the env to (Talking about cloudflare since it seems to be the only integration that causes us to need to expose an API) |
That's because cloudflare env is loaded using wrangler platform proxy, it does not come from process env. We still need to call |
But why does the cloudflare platform proxy interfere with Anyways, if cloudflare wants to emulate |
There's a good reason for that! That's because an adapter can't set |
I think I get it now, and I think the true fix for this is indeed to have the adapters assign directly to If we follow this PR and assign the adapter env to a global symbol, it wouldn't work anyways because the next Fundamentally, I don't think we should have assigned it to a global symbol or |
Just to confirm I understand correctly: what we should do is just have an internal thing on globalThis, and adapters keep augmenting process.env. Is that right? |
Yes 👍 |
Changes
Testing
Should still pass. I'll make a preview release to test adapters
Docs
Changeset, will do docs later