Skip to content

fix: remove types: ['node'] from generated tsconfig#15709

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-svelte-check-incremental-issue
Open

fix: remove types: ['node'] from generated tsconfig#15709
Copilot wants to merge 2 commits intomainfrom
copilot/fix-svelte-check-incremental-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

The generated .svelte-kit/tsconfig.json hardcodes types: ['node'], which produces TS2688 when @types/node isn't installed. This silently causes svelte-check --incremental to skip standalone .ts files (e.g. +server.ts, utility modules), missing type errors that non-incremental mode catches.

  • Remove types: ['node'] from the generated compilerOptions in write_tsconfig.js

Without types, TypeScript falls back to its default behavior: auto-include all @types/* packages present in node_modules. Users with @types/node installed see no change; users without it no longer get a phantom error that breaks incremental checking.

EDIT: I might want to add a failing test for this

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 11, 2026

🦋 Changeset detected

Latest commit: aa61d1f

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

…hen @types/node is not installed

Agent-Logs-Url: https://github.com/sveltejs/kit/sessions/48ebb06e-0f17-45da-8115-b50acaf6d293

Co-authored-by: teemingc <54401897+teemingc@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix svelte-check incremental mode to include standalone .ts files fix: remove types: ['node'] from generated tsconfig Apr 11, 2026
Copilot AI requested a review from teemingc April 11, 2026 17:28
@teemingc teemingc marked this pull request as ready for review April 12, 2026 16:58
@dummdidumm
Copy link
Copy Markdown
Member

I believe in TS 6/7 the default is the empty array so this would break it for users of that version. We might have to check whether the types exist and add the array or not depending on the outcome

@teemingc
Copy link
Copy Markdown
Member

teemingc commented Apr 13, 2026

I believe in TS 6/7 the default is the empty array so this would break it for users of that version. We might have to check whether the types exist and add the array or not depending on the outcome

That’s true. But, we didn’t have this before moving to TypeScript 6, and those who chose to upgrade would have had to deal with a bunch of breaking changes anyway. Therefore, I’m wondering if it’s better for users to add the types array themselves in the user config. It would be a little weird if only node was automatically added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

svelte-check --incremental skips standalone .ts files

3 participants