Skip to content

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

@DetachHead

Description

@DetachHead

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

node_modules/svelte-preprocess/dist/types/index.d.ts:2:106 - error TS2307: Cannot find module 'svelte/types/compiler/preprocess' or its corresponding type declarations.

2 import type { Processed as SvelteProcessed, Preprocessor as SveltePreprocessor, PreprocessorGroup } from 'svelte/types/compiler/preprocess';
                                                                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/svelte-preprocess/dist/types/index.d.ts:4:35 - error TS2307: Cannot find module 'svelte/types/compiler/preprocess' or its corresponding type declarations.

4 export { PreprocessorGroup } from 'svelte/types/compiler/preprocess';
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svelte.config.js:12:14 - error TS2349: This expression is not callable.
  Type 'typeof import("/home/projects/sveltejs-kit-template-default-b9wpnr/node_modules/svelte-preprocess/dist/index")' has no call signatures.

12  preprocess: preprocess()
                ~~~~~~~~~~

Logs
Please include browser console and server logs around the time this bug occurred.

To Reproduce

  1. go to https://stackblitz.com/edit/sveltejs-kit-template-default-b9wpnr?file=svelte.config.js
  2. wait for the dev npm script to finish
  3. check the output

Expected behavior
A clear and concise description of what you expected to happen.

Information about your project:

  • svelte-preprocess version: 5.0.3

Additional context

other related issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions