Skip to content

fix: allow $app/environment with a warning when explicitEnvironmentVariables is enabled#15980

Merged
Rich-Harris merged 2 commits into
mainfrom
allow-app-environment
Jun 8, 2026
Merged

fix: allow $app/environment with a warning when explicitEnvironmentVariables is enabled#15980
Rich-Harris merged 2 commits into
mainfrom
allow-app-environment

Conversation

@Rich-Harris
Copy link
Copy Markdown
Member

If you're using a library that uses $app/environment, enabling explicitEnvironmentVariables will blow everything up. This fixes it


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 8, 2026

🦋 Changeset detected

Latest commit: 27e0fe1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

Comment thread packages/kit/src/runtime/app/environment/index.js Outdated
@svelte-docs-bot
Copy link
Copy Markdown

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
@Rich-Harris
Copy link
Copy Markdown
Member Author

self-merging to unblock deploy previews etc

@Rich-Harris Rich-Harris merged commit 0fd507c into main Jun 8, 2026
28 of 29 checks passed
@Rich-Harris Rich-Harris deleted the allow-app-environment branch June 8, 2026 02:06
@github-actions github-actions Bot mentioned this pull request Jun 8, 2026
Rich-Harris pushed a commit that referenced this pull request Jun 8, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @sveltejs/kit@2.63.1

### Patch Changes


- fix: use SSE for `query.live`
([#15957](#15957))


- fix: use forward slashes in the generated `env.d.ts` import path on
Windows ([#15977](#15977))


- fix: allow `$app/environment` with a warning when
`explicitEnvironmentVariables` is enabled
([#15980](#15980))


- fix: avoid importing Vite while validating explicit environment
variables ([#15953](#15953))


- docs: adjust the release version of explicit env vars
([#15968](#15968))


- fix: ensure `version` is defined when importing from `$app/env` with
explicit environment variables
([#15971](#15971))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant