question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

svelte-kit build swallows typescript errors

See original GitHub issue

Describe the bug Errors in .ts files are silently ignored when running svelte-kit build.

Logs N/A

To Reproduce

  1. Enable some feature in tsconfig.json, such as strictNullChecks or noUnusedLocals, then write some code that breaks that rule. For example, setting noUnusedLocals: true then writing let unusedVar = 42;.
  2. 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
thislooksfuncommented, May 24, 2021

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 of svelte-kit dev which would be insanely useful for detecting errors as we go, rather than having to manually check afterwards.

0reactions
dummdidummcommented, May 28, 2021

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 that svelte-check --watch is called, which I’d rather have explicit in my package.json. My development workflow for example relies on IDE checks during dev and then svelte-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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found