Skip to content

tsconfig.json error: Cannot write file 'src/service-worker.js' because it would overwrite input file #985

Closed
@frederikhors

Description

@frederikhors

Describe 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 #716.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions