Skip to content

compile errors when typechecking svelte.config.js with moduleResolution set to nodenext #9663

@DetachHead

Description

@DetachHead

Describe the bug

when typechecking svelte.config.js with moduleResolution set to nodenext, the following compile errors occur:

❯ tsc svelte.config.js --allowjs --noemit --moduleresolution nodenext
node_modules/@sveltejs/kit/types/index.d.ts:6:32 - error TS2307: Cannot find module 'svelte/types/compiler/interfaces' or its corresponding type declarations.

6 import { CompileOptions } from 'svelte/types/compiler/interfaces';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@sveltejs/kit/types/internal.d.ts:408:15 - error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

408 export * from './index';
                  ~~~~~~~~~

node_modules/@sveltejs/kit/types/internal.d.ts:409:15 - error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

409 export * from './private';
                  ~~~~~~~~~~~

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-s2bims?file=package.json

Logs

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.0.0 
    @sveltejs/kit: ^1.5.0 => 1.15.5 
    svelte: ^3.54.0 => 3.58.0 
    vite: ^4.2.0 => 4.2.1

Severity

serious, but I can work around it

Additional Information

other related issues:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions