Skip to content

Conversation

martinslota
Copy link
Contributor

@martinslota martinslota commented Aug 9, 2025

Fail with an informative error message on a file with a broken default import.

PR Checklist

Overview

Fail with an informative error message on a file with a broken default import.

Copy link

linux-foundation-easycla bot commented Aug 9, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@martinslota martinslota changed the title Fixes #5411. Fail with an informative error message on a file with a broken default import Aug 9, 2025
Fail with an informative error message on a file with a broken default import.
@martinslota martinslota force-pushed the fix-mocha-default-import-error-message branch from edb0e34 to e171a5d Compare August 9, 2025 19:50
@mark-wiemer
Copy link
Member

Nice :) cursory review looks good, I'll dive deep into this tomorrow as I'm still a new maintainer

@mark-wiemer mark-wiemer marked this pull request as ready for review August 10, 2025 23:12
@mark-wiemer mark-wiemer changed the title Fail with an informative error message on a file with a broken default import fix: Fail with an informative error message on a file with a broken default import Aug 10, 2025
@mark-wiemer mark-wiemer changed the title fix: Fail with an informative error message on a file with a broken default import fix: fail with an informative error message on a file with a broken default import Aug 12, 2025
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable for the intended behavior, but I'm not sure the intended behavior is what we want?

Thanks for starting this though, the change is very clean!

…w the require error in case the import error is ERR_INTERNAL_ASSERTION
@mark-wiemer
Copy link
Member

@martinslota can you resolve merge conflicts?

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mark-wiemer mark-wiemer merged commit b0e6135 into mochajs:main Sep 1, 2025
90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug: Unhelpful error message when a default import is made from a module without a default export

3 participants