Skip to content

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

@codecov
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.23%. Comparing base (b197355) to head (7d95b68).
Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #56491   +/-   ##
=======================================
  Coverage   90.23%   90.23%           
=======================================
  Files         633      633           
  Lines      186818   186834   +16     
  Branches    36668    36673    +5     
=======================================
+ Hits       168578   168595   +17     
- Misses      11036    11038    +2     
+ Partials     7204     7201    -3     
Files with missing lines Coverage Δ
lib/internal/modules/esm/module_job.js 97.21% <100.00%> (+0.09%) ⬆️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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.

@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 13, 2025

Can we move this forward? @JakobJingleheimer
Did you have time to check it? @jsumners-nr

Copy link

@jsumners-nr jsumners-nr left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@jsumners-nr
Copy link

Can we move this forward? @JakobJingleheimer Did you have time to check it? @jsumners-nr

I was out all last week due to illness.

@JakobJingleheimer JakobJingleheimer added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 13, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 13, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung
Copy link
Member

You can remove the TODO in L395 now because that's talking about...this :)

The other TODO relies on the V8 13.0 upgrade which is blocked on...the macOS upgrade in the CI, sigh.

@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 22, 2025

It seems the two failing test are because --experimental-permission is no longer experimental and test-runner-module-mocking.js doesn't exist (maybe is test-runner-mocking.js?) I tried rebasing locally but didn't work so not sure what to do

@joyeecheung
Copy link
Member

Those two came from security release hiccups and should be fixed by 01dd7c4 - not sure about whether the GitHub actions are able to rebase. Can you rebase locally and force push here?

@Ceres6 Ceres6 force-pushed the chore/clarify-cjs-global-error branch from c05d02a to 2b6cb3f Compare January 23, 2025 07:56
@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 23, 2025

Done

@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 26, 2025

Do we need anything else to move this forward?

@JakobJingleheimer JakobJingleheimer added the request-ci Add this label to start a Jenkins CI on a PR. label May 14, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 15, 2025
@nodejs-github-bot
Copy link
Collaborator

@JakobJingleheimer JakobJingleheimer added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels May 16, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 16, 2025
@nodejs-github-bot nodejs-github-bot merged commit b6189c3 into nodejs:main May 16, 2025
64 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in b6189c3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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.

7 participants