Skip to content

check fails in library template with typescript and devtools-json #665

@SymphonySimper

Description

@SymphonySimper

Issue

npm run check

> npm run check

> svelte-lib@0.0.1 check
> svelte-kit sync && svelte-check --tsconfig ./tsconfig.json

Loading svelte-check in workspace: /tmp/svelte-lib
Getting Svelte diagnostics...

/tmp/svelte-lib/vite.config.ts:6:25
Error: This expression is not callable.
  Type 'typeof import("/tmp/svelte-lib/node_modules/vite-plugin-devtools-json/dist/index")' has no call signatures.
export default defineConfig({
        plugins: [sveltekit(), devtoolsJson()]
});

====================================
svelte-check found 1 error and 0 warnings in 1 file

Workaround

Changing moduleResolution in tsconfig.json to bundler fixes the issue.

--- a/tsconfig.json
+++ b/tsconfig.json
@@ -10,6 +10,6 @@
 		"sourceMap": true,
 		"strict": true,
 		"module": "NodeNext",
-		"moduleResolution": "NodeNext"
+		"moduleResolution": "bundler"
 	}
 }

npm run check

> npm run check

> svelte-lib@0.0.1 check
> svelte-kit sync && svelte-check --tsconfig ./tsconfig.json

Loading svelte-check in workspace: /tmp/svelte-lib
Getting Svelte diagnostics...

svelte-check found 0 errors and 0 warnings

Note

Project was created with the following command. And devtools-json was added with interactive add-on installer.

npx sv@latest create --template library --types ts --install npm svelte-lib

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions