Closed DetachHead closed 3 weeks ago
this also causes two even more severe issues:
# compile errors when trying to import another svelte component
```svelte
Could you provide a reproduction for this? This sounds a bit unrelated - moduleResolution shouldn't have impact on how things are resolved at runtime, unless Vite is doing something funky there.
yeah i can't reproduce that anymore updating to typescript 5, must've been the same issue as #612
however the issue in the OP still occurs
Fixed as part of #640
I'm still getting it
src/internal/configurations.js:12:14 - error TS2349: This expression is not callable.
Type 'typeof import("/home/alex/git/@aa/js-tooling/node_modules/.pnpm/svelte-preprocess@6.0.0_postcss-load-config@6.0.1_postcss@8.4.38__postcss@8.4.38_svelte@4.2.18_typescript@5.4.5/node_modules/svelte-preprocess/dist/index")' has no call signatures.
12 preprocess: sveltePreprocess(),
~~~~~~~~~~~~~~~~
When trying to import the default import.
import { default as sveltePreprocess } from 'svelte-preprocess';
/**
* @type {import('./types.js').Config}
*/
export const libConfiguration = {
preprocess: sveltePreprocess(),
};
I think this happened before 6.0.0
too but I was just importing it from inside the package
import { sveltePreprocess } from 'svelte-preprocess/dist/autoProcess.js';
But I can no longer do this (since the exports object was defined in this versions package.json)
src/internal/configurations.js:4:34 - error TS2307: Cannot find module 'svelte-preprocess/dist/autoProcess.js' or its corresponding type declarations.
4 import { sveltePreprocess } from 'svelte-preprocess/dist/autoProcess.js';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Relevant TSConfig:
{
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext"
}
}
It would be nice to just have this export also exported as a named export. Default exports are such a headache sometimes..
With
"moduleResolution": "Bundler",
it works as intended
For now I can just // @ts-ignore
it
If you do import sveltePreprocess from 'svelte-preprocess'
everything should work as intended.
No, I tried that too, forgot to mention.
In 6.0.1 you can now do import { sveltePreprocess } from 'svelte-preprocess'
which should work with NodeNext, too
Describe the bug when typechecking
svelte.config.js
withmoduleResolution
set tonodenext
, the following compile errors occur:Logs Please include browser console and server logs around the time this bug occurred.
To Reproduce
dev
npm script to finishExpected behavior A clear and concise description of what you expected to happen.
Information about your project:
svelte-preprocess
version: 5.0.3Additional context
other related issues: