-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
avoid double import of $env/dynamic/[mode]
modules
#5955
Conversation
🦋 Changeset detectedLatest commit: af28ffc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Will this prevent the user from being able to change the env files after server startup? |
Changing |
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.
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.
@benmccann it looks like the issue is that we're slightly tapping into Vite's internals to load env-private.js
and env-public.js
, where if Vite controls the entire import analysis flow, it would usually load them as /node_modules/@sveltejs/kit/src/runtime/env-private.js
. Only imports outside of root would (usually?) use /@fs
, which this PR changes to emulate this.
Ideally we would put these runtime files in pkg.exports
, so we can ssrLoadModule
them directly without resolving the path ourselves, but @Rich-Harris brought up that we want to keep this private API and intellisense-wise.
I think the solution now is fine, but if more issues appear later, it could be worth investigating a safer way.
Attempt to fix #5941. No test because the bug doesn't happen inside the workspace
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0