Svelte's tooling ignores TypeScript code from previous preprocessors
#1567
Labels
limitation
Constraints of the existing architecture make this hard to fix
Description
Speaking of the VS Code extension and the
svelte-check
command, when I'm adding my own preprocessor that modifies the script tag to include additionalTypeScript
syntax, that part gets ignored by the tooling.I tried
svelte-check
and added some debug logs to see if the custom preprocessor get's loaded. The logs show up, but If I'm adding TypeScript syntax, the tooling ignores it.Not sure what exactly happens, but it seems that the last preprocessor doesn't use the full output from the previous preprocessors.
Proposed solution
The VS Code extension and
svelte-check
should take the input from the previous preprocessors.Alternatives
Leave it like it is and don't allow custom use-cases.
Additional Information, eg. Screenshots
Here is my
svelte.config.js
fileThe first preprocessor will add the generated type imports for the
Load
function.The second preprocessor checks if the first preprocessor modified the source code
The third preprocessor is the usual
svelte-preprocess
that ccan handleTypeScript
syntaxHere is my custom route
routes/test/[id]/summary
:When running

svelte-check
I get following error:As you can see my custom preprocessor gets executed, but in the end I still see an error because the type import for
Load
is missing.The text was updated successfully, but these errors were encountered: