Closed
Description
Describe the bug
When compiling a Typescript code that uses svelte/compile
, it fails because of missing libraries inside Svelte package.
Logs
node_modules/svelte/types/compiler/index.d.ts:4:22 - error TS2307: Cannot find module 'estree-walker'.
4 export { walk } from 'estree-walker';
~~~~~~~~~~~~~~~
node_modules/svelte/types/compiler/preprocess/index.d.ts:1:27 - error TS2307: Cannot find module 'magic-string'.
1 import { SourceMap } from 'magic-string';
~~~~~~~~~~~~~~
To Reproduce
- Create new Node project:
npm init -y
at empty folder - Install Svelte and Tyepscript:
npm i -D svelte typescript
- Configure Typescript:
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"outDir": "./build",
"noEmitOnError": true,
"noImplicitAny": true
},
"files": [
"test.ts"
]
}
- Create
test.ts
with the following import:import * as svelte from 'svelte/compiler'
- Run
npx tsc
Expected behavior
I should not need to manually install Svelte's dependencies; compilation should not fail.
Information about your Svelte project:
- Svelte: 3.8.0
- Typescript: 3.5.3
Severity
Annoying. I can manually install Svelte's dependencies into my project.
Metadata
Metadata
Assignees
Labels
No labels