Repository navigation
fix: surface ts-node compile errors - #5572
Merged
Merged
Conversation
Prevents "Cannot find module" when there are TS errors
3 of 4 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5572 +/- ##
=======================================
Coverage 93.52% 93.53%
=======================================
Files 57 57
Lines 4465 4467 +2
Branches 918 919 +1
=======================================
+ Hits 4176 4178 +2
Misses 289 289 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
JoshuaKGoldberg
requested changes
Dec 18, 2025
JoshuaKGoldberg
left a comment
Member
There was a problem hiding this comment.
I agree with the strategy, but would really like a spot check from another maintainer to make sure there's no way we can get around it.
Just requesting changes on moving the debug() line.
Thanks!
4 tasks done
…-mod-not-found * 'ts-mod-not-found' of github.com:sam-super/mocha: feat: add mocha.mjs export (mochajs#5527) docs: bumped docs-next Astro to ^5.16.6 (mochajs#5574) build(dev-deps): upgrade `markdownlint-cli` to latest v0.46.0 (mochajs#5560)
mark-wiemer
self-requested a review
December 19, 2025 08:08
JoshuaKGoldberg
requested review from
mark-wiemer
and removed request for
mark-wiemer
December 24, 2025 17:54
mark-wiemer
approved these changes
Dec 31, 2025
Member
|
Test failure is known transient issue (#5361), merging. Thank you! |
This was referenced Jan 11, 2026
lennonnikolas
pushed a commit
to lennonnikolas/mocha
that referenced
this pull request
Jan 24, 2026
* fix: surface ts-node compile errors Prevents "Cannot find module" when there are TS errors * fix: remove ts-node error condition check below debug logging
4 of 5 tasks
|
Thanks for the fix. Could this be downported to v11? |
Member
|
Created #6029 :) |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
status: accepting prsOverview
Prevents "Cannot find module" when there are TS errors by prevent fallback to 'import()' when it errors.
The downside is this is tightly coupled to how ts-node throws errors when loading modules. However, this change seems unlikely to have any unexpected side-effects, so the risk is that it wont help if someone is using a different TS loader, but it's still a net gain for most.