fix: remove types: ['node'] from generated tsconfig#15709
fix: remove types: ['node'] from generated tsconfig#15709
types: ['node'] from generated tsconfig#15709Conversation
🦋 Changeset detectedLatest commit: aa61d1f 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 |
…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>
types: ['node'] from generated tsconfig
|
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. |
The generated
.svelte-kit/tsconfig.jsonhardcodestypes: ['node'], which produces TS2688 when@types/nodeisn't installed. This silently causessvelte-check --incrementalto skip standalone.tsfiles (e.g.+server.ts, utility modules), missing type errors that non-incremental mode catches.types: ['node']from the generatedcompilerOptionsinwrite_tsconfig.jsWithout
types, TypeScript falls back to its default behavior: auto-include all@types/*packages present innode_modules. Users with@types/nodeinstalled 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