New tsconfig of create-vite gives type errors if .d.ts
files can not be generated
#17638
Closed
7 tasks done
Labels
p3-downstream-blocker
Blocking the downstream ecosystem to work properly (priority)
regression
The issue only appears after a new release
Describe the bug
This PR introduced new default values for the tsconfig.json created with create-vite:
#15913
This PR uses TS references and sets
composite: true
in tsconfig.json:vite/packages/create-vite/template-react-ts/tsconfig.app.json
Lines 1 to 9 in 167006e
The references feature uses
.d.ts
files when references reference each other. Sodeclaration
is forced to be set to true:https://www.typescriptlang.org/tsconfig/#declaration
This gives quite some extra TS errors.
In storybook, *.stories.ts files are usually not written in a way that allows .d.ts files to be generated from them.
In a fresh storybook vite react project, users now get the following TS error:
Reproduction
https://stackblitz.com/edit/github-nup1wj?file=src%2Fvite-env.d.ts
Steps to reproduce
Clone the stackblitz repro locally. As stackblitz is also broken by this PR.
The error will popup in your editor in Button.stories.tsx, but not when running tsc on the command line.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: