You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In SvelteKit 3, $app/tsconfig sets module: "esnext" / moduleResolution: "bundler". With "module": "nodenext", $app/types/env.d.ts (declares $app/env/public and $app/env/private) is no longer picked up unless it is in include.
The tsconfig task of sv migrate sveltekit-3 keeps nodenext (it differs from the inherited default) but doesn't add the file to include.
Reproduction
sv create blank --template minimal --types ts
Set compilerOptions.module and moduleResolution to "nodenext" in tsconfig.json.
Add import { PUBLIC_FOO } from '$app/env/public'; to a .ts file.
tsc --noEmit or svelte-check.
module
include has node_modules/$app/types/env.d.ts
$app/env/public
nodenext
no
TS2307: Cannot find module
nodenext
yes
resolves
default
no
resolves
$app/env (e.g. browser) resolves in all cases.
Expected
Either:
the migration adds node_modules/$app/types/env.d.ts to include when module is not esnext, or
$app/tsconfig/the docs state that nodenext users must add it.
Stopped before reproduction, branch creation, or edits: The workflow requires stopping when an open upstream PR already addresses the issue; no product code was changed, committed, or pushed.
Why I stopped
An existing open upstream PR already addresses this bug: #17351. Creating a competing fix would duplicate active maintainer work, so the task was stopped per the prior-art rule.
Activity
svelte-triage-bot commentedon Oct 5, 2026
I reproduced the issue, but could not produce a safe, verified fix.
What I tried
sv migrate sveltekit-3: tsconfig with"module": "nodenext"loses$app/env/*types #17350: The issue is open and GitHub reports one configured closing pull request: fix: ensure relative imports in generated types work with nodenext #17351.sv migrate sveltekit-3: tsconfig with"module": "nodenext"loses$app/env/*types #17350, explains that NodeNext requires file endings even for .d.ts imports, and includes a Kit patch changeset.Why I stopped
An existing open upstream PR already addresses this bug: #17351. Creating a competing fix would duplicate active maintainer work, so the task was stopped per the prior-art rule.
fix: ensure relative imports in generated types work with nodenext (s…