-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
Description
Describe the bug
Hello. After setting up a Svelte project with Typescript, I bumped into an error with missing type definitions for estree. I think they should ship with Svelte by default.
Reproduction
- Run
yarn create vite my-app --template svelte-ts - In package.json, change the build script to
tsc --noEmit && vite build - Run
yarn build
Running yarn add -D @types/estree solves the issue.
Logs
../../.yarn/berry/cache/svelte-npm-4.2.8-42f12ed9c1-10c0.zip/node_modules/svelte/types/index.d.ts:276:59 - error TS2307: Cannot find module 'estree' or its corresponding type declarations.
276 import type { AssignmentExpression, Node, Program } from 'estree';
~~~~~~~~
../../.yarn/berry/cache/svelte-npm-4.2.8-42f12ed9c1-10c0.zip/node_modules/svelte/types/index.d.ts:868:59 - error TS2307: Cannot find module 'estree' or its corresponding type declarations.
868 import type { AssignmentExpression, Node, Program } from 'estree';
~~~~~~~~
Found 2 errors in the same file, starting at: ../../.yarn/berry/cache/svelte-npm-4.2.8-42f12ed9c1-10c0.zip/node_modules/svelte/types/index.d.ts:276System Info
System:
OS: macOS 12.5
CPU: (10) arm64 Apple M1 Max
Memory: 253.09 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
Yarn: 4.0.2 - ~/.nvm/versions/node/v20.10.0/bin/yarn
npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
Browsers:
Chrome: 120.0.6099.129
Safari: 15.6Severity
annoyance