You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's probably two things here: a Typescript bug, and svelte-preprocess hiding information about it.
src/routes/index.svelte.injected.ts:6:19 - error TS1127: Invalid character.
6 const $$vars$$ = [\s];
[svelte-preprocess] Encountered type error
Error: [svelte-preprocess] Encountered type error
at throwError (/home/tv/src/eagain.net/2021/typescript-parser-bug/node_modules/svelte-preprocess/dist/modules/errors.js:5:11)
at throwTypescriptError (/home/tv/src/eagain.net/2021/typescript-parser-bug/node_modules/svelte-preprocess/dist/modules/errors.js:9:28)
at transpileTs (/home/tv/src/eagain.net/2021/typescript-parser-bug/node_modules/svelte-preprocess/dist/transformers/typescript.js:177:47)
at mixedImportsTranspiler (/home/tv/src/eagain.net/2021/typescript-parser-bug/node_modules/svelte-preprocess/dist/transformers/typescript.js:232:60)
at transformer (/home/tv/src/eagain.net/2021/typescript-parser-bug/node_modules/svelte-preprocess/dist/transformers/typescript.js:297:11)
at transform (/home/tv/src/eagain.net/2021/typescript-parser-bug/node_modules/svelte-preprocess/dist/autoProcess.js:37:12)
at async /home/tv/src/eagain.net/2021/typescript-parser-bug/node_modules/svelte-preprocess/dist/autoProcess.js:118:29
at async script (/home/tv/src/eagain.net/2021/typescript-parser-bug/node_modules/svelte-preprocess/dist/autoProcess.js:148:33)
at async process_single_tag (file:///home/tv/src/eagain.net/2021/typescript-parser-bug/node_modules/svelte/compiler.mjs:31571:27)
at async Promise.all (index 0)
So, the error is in an "injected" file. The location in that file does not help me locate the problem in the actual source file. In this simplified example, error is on line 6, but the original source file is three lines long:
<script lang="ts">
// /^\$\s*/
</script>
This was quite frustrating to pinpoint, as the original file was much larger, and commenting out code didn't help.
To Reproduce
This should trigger with just about any *.svelte file using TS with that explosive comment, but just for completeness, here's all the files for a reproducer:
Describe the bug
There's probably two things here: a Typescript bug, and svelte-preprocess hiding information about it.
So, the error is in an "injected" file. The location in that file does not help me locate the problem in the actual source file. In this simplified example, error is on line 6, but the original source file is three lines long:
This was quite frustrating to pinpoint, as the original file was much larger, and commenting out code didn't help.
To Reproduce
This should trigger with just about any
*.svelte
file using TS with that explosive comment, but just for completeness, here's all the files for a reproducer:The text was updated successfully, but these errors were encountered: