Typescript and noEmitOnError regressions/issues
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- node.js, typescript
- Domain
- build-system, tooling
Research direction
Start with the StackBlitz reproduction linked in the issue and run its npm run build, npm run watch, and npm run typecheck commands. Inspect the @rollup/plugin-typescript handling of noEmitOnError during build and watch mode. Done means all type errors are reported, builds fail without emitting known-bad JavaScript, and watch mode continues and rebuilds after subsequent fixes.
Written by the indexing model from the issue text.
Description
- Rollup Plugin Name: @rollup/plugin-typescript
- Rollup Plugin Version: 12.3.0
- Rollup Version: 4.62.4
- Operating System (or Browser): Linux
- Node Version: v24.19.0
- Link to reproduction (⚠️ read below): https://stackblitz.com/edit/rollup-repro-g4psnqpv?file=src%2Fmain.ts
Expected Behavior
When noEmitOnError is set, running npm run build (set to rollup -c rollup.config.js) should show all typecheck errors approximately as tsc does, and then fail. Similarly, npm run watch (set to rollup -c rollup.config.js -w) should keep watching even if there are typecheck errors.
Actual Behavior
When npm run build is run, it displays the first typecheck error and then crashes (with a stack trace that takes up several lines of console space, meaning you have to scroll up to see the one error, but I think thatʼs a different issue). It does not display other errors.
When npm run watch is run, it shows just one error (and long stacktrace) and then looks like itʼs going to continue watching, but when you change the file in a way that still fails to typecheck it crashes immediately. If you change the file in a way that does typecheck, then the watch process neither produces any output to the terminal nor actually builds the file.
Additional Information
I added a typecheck script so npm run typecheck can show you all the errors not just the first.
Several previous issues (#255, #258, #272, #492) recommend turning off noEmitOnError at least during a rollup --watch, and at least one PR (#544) claims to do that. I donʼt find that a good fix for a few reasons
- The README says that used to be an issue but that itʼs now fine to turn on
noEmitOnError - I do not want to ever emit javascript I know is bad; I do not want to accidentally run it if I fail to pay attention to the window where
rollup --watchis running, and I do not want to accidentally build it and then not realize I have known-bad code.
- Dominant language
- JavaScript
- Stars
- 3.8k
- Forks
- 635
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rollup/plugins
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Support js-yaml v5 Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Babel 8 support Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
ecosystem wording
Difficulty 1/5 Under an hour Newbie friendliness 90/100
matrix-org/matrix.org#3649 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·