tsconfig.json error: Cannot write file 'src/service-worker.js' because it would overwrite input file
See original GitHub issueDescribe the bug
Reading the docs about service worker I added an empty service-worker.js
in my src
dir.
I need it empty so vite sees it and produces the code to register it in the final bundle (I will fill in the file afterwards).
But now my (default) tsconfig.json
is complaining with:
{
"resource": "/c:/kit/tsconfig.json",
"owner": "typescript",
"severity": 8,
"message": "Cannot write file 'c:/kit/src/service-worker.js' because it would overwrite input file.",
"source": "ts",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 2
}
Why?
Information about your SvelteKit Installation:
Diagnostics
-
The output of
npx envinfo --system --npmPackages svelte,@sveltejs/kit,vite --binaries --browsers
:System: OS: Windows 10 10.0.19042 Binaries: Node: 14.16.1 - C:\Program Files\nodejs\node.EXE npm: 7.9.0 - C:\Program Files\nodejs\npm.CMD npmPackages: @sveltejs/kit: 1.0.0-next.71 => 1.0.0-next.71 svelte: 3.37.0 => 3.37.0 vite: 2.1.5 => 2.1.5
-
Your adapter: static
Additional context Maybe related to https://github.com/sveltejs/kit/pull/716.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
For me this is not related to service worker. I’ve inited svelte project and I don’t have it for now.
Reproducable like this: (choose yes to typesrcipt)
EDIT: Sorry guys for ping. This is svelte vscode extension issue. After restarting it everything works fine. In case I will get any problems I’ll open issue in svelte language tools repo
@ignatiusmb thanks for the reply! Restarting Svelte Language Server did the trick 👍 Sorry, was completely unaware of that, ~~in case somebody has the same issue: https://github.com/UnwrittenFun/svelte-vscode/blob/master/docs/preprocessors/typescript.md#:~:text=Restart the svelte language server&text=Hit ctrl-shift-p or,re now all set up!~~
Edit: see comment below