Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module: clarify cjs global-like error on ModuleJobSync #56491

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Ceres6
Copy link
Contributor

@Ceres6 Ceres6 commented Jan 6, 2025

This PR copies the error message used for cjs global-like import errors from ModuleJob to ModuleJobSync to cover more cases.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. labels Jan 6, 2025
@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 6, 2025

cc @JakobJingleheimer @jsumners

@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 6, 2025

There is still one case that I think should be covered by this message highlighted by https://github.com/nodejs/node/blob/main/test/es-module/test-esm-detect-ambiguous.mjs#L212 where an import cjs.js in a package with type: module has the same behaviour but doesn't trigger the message as the error is caught by the module that is importing it, which could be mjs or cjs

@jsumners
Copy link
Contributor

jsumners commented Jan 6, 2025

For my own clarification: why am I tagged on this one?

@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 6, 2025

For my own clarification: why am I tagged on this one?

Not sure if I tagged wrong. I saw this repro on the nodejs loaders group https://github.com/jsumners-nr/exports-bug

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 62.96296% with 10 lines in your changes missing coverage. Please review.

Project coverage is 89.12%. Comparing base (b0c65bb) to head (e009ed2).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/modules/esm/module_job.js 62.96% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56491      +/-   ##
==========================================
+ Coverage   88.52%   89.12%   +0.59%     
==========================================
  Files         660      662       +2     
  Lines      190900   191580     +680     
  Branches    36628    36863     +235     
==========================================
+ Hits       168995   170742    +1747     
+ Misses      15090    13704    -1386     
- Partials     6815     7134     +319     
Files with missing lines Coverage Δ
lib/internal/modules/esm/module_job.js 96.96% <62.96%> (-2.29%) ⬇️

... and 75 files with indirect coverage changes

@JakobJingleheimer
Copy link
Member

For my own clarification: why am I tagged on this one?

@jsumners you sort of requested this in slack about a month ago :)

@jsumners
Copy link
Contributor

jsumners commented Jan 6, 2025

For my own clarification: why am I tagged on this one?

Not sure if I tagged wrong. I saw this repro on the nodejs loaders group https://github.com/jsumners-nr/exports-bug

Thank you. Please tag @jsumners-nr instead. That is my work account.

@JakobJingleheimer
Copy link
Member

I presume you're asking so it will give you a reminder (which it won't do when you tag yourself). @jsumners-nr :)

@jsumners
Copy link
Contributor

jsumners commented Jan 6, 2025

I participate in the loaders group through my work persona. I will review when I am back at work tomorrow. Technically, I wouldn't be tagging myself since it is separate accounts. I'm really just trying to make it clear which account to use for these things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants