Skip to content

v4: src/compiler/tsconfig.json extends non-exist file #8839

@hyrious

Description

@hyrious

Describe the bug

https://cdn.jsdelivr.net/npm/[email protected]/src/compiler/tsconfig.json

It references {svelte}/tsconfig.json but the file does not exist. Which will make TypeScript project show errors when importing types from svelte.

This might because there is "files": ["src"] in package.json which includes the nested tsconfig.json file.

I'd suggest remove the 2 tsconfig.json files in release.

Reproduction

Snipaste_2023-06-25_09-19-58

Create an empty TypeScript project with some code that uses svelte types. If you click into that type, the TypeScript server will start analyzing tsconfig.json and report errors.

Well this might be a bug in VS Code that it shouldn't report issues in node_modules with skipLibCheck: true. However this is never being fixed in years.

Logs

Cannot read file '/private/tmp/test-svelte-4/node_modules/svelte/tsconfig.json'.

System Info

System:
    OS: macOS 13.4
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 29.34 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.3.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.7.1 - /usr/local/bin/npm
    Watchman: 2023.06.12.00 - /usr/local/bin/watchman
  Browsers:
    Safari: 16.5
  npmPackages:
    svelte: ^4.0.0 => 4.0.0

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueA small, encapsulated issue, ideal for a new contributor to Svelte to tackle.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions