svelte-kit build swallows typescript errors
See original GitHub issueDescribe the bug
Errors in .ts files are silently ignored when running svelte-kit build
.
Logs N/A
To Reproduce
- Enable some feature in
tsconfig.json
, such asstrictNullChecks
ornoUnusedLocals
, then write some code that breaks that rule. For example, settingnoUnusedLocals: true
then writinglet unusedVar = 42;
. - Run
svelte-kit build
Expected behavior
I expect that svelte-kit build
would fail (exit != 0) and give a helpful error message. Instead it just silently succeeds, even though compiling the exact same code with tsc
correctly errors.
Stacktraces N/A
Information about your SvelteKit Installation:
N/A
Severity Very annoying, means that I can’t rely on the build process to catch errors so I have to spend extra time checking for them manually and also worry about an avoidable bug slipping through the cracks.
Additional context N/A
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Feature: type-checking · Issue #205 · sveltejs/svelte-preprocess
Writing TypeScript without type checking is like writing Java code without type checking, ... svelte-kit build swallows typescript errors sveltejs/kit#1536.
Read more >Is there a way to mute a specific errror? Eg. ts(7053) : r/typescript
This is to ensure that you aren't ignoring things which are no longer errors and thus possibly swallowing future errors which are different ......
Read more >M Λ T T Y (@Matt_Pilott) / Twitter
Updating a #sveltekit project to use the new routes structure. It's a tough pill to swallow…
Read more >Turbopack, the successor to Webpack - Hacker News
When I finally built my perfect set of webpack configs, I deleted them after a couple of months ... My team cannot commit...
Read more >Introducing Svelte, and Comparing Svelte with React and Vue
We've talked about how SvelteKit's components compile and ship as minimal, self-contained JavaScript, which means there's no overhead of a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure it’s more explicit, but there’s still a reason why tooling like
tsc
has it built in. Besides, that still doesn’t address having type checking as part ofsvelte-kit dev
which would be insanely useful for detecting errors as we go, rather than having to manually check afterwards.svelte-kit dev
uses Vite under the hood, which does not do any type checking. So if it was “built-in”, it would again mean thatsvelte-check --watch
is called, which I’d rather have explicit in mypackage.json
. My development workflow for example relies on IDE checks during dev and thensvelte-check
prior to the build. It works for other CLIs like Angular or Vue because they use webpack, where they can integrate the typechecking into the process.