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

esm: add a fall back when importer in not a file #55471

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Oct 20, 2024

There's this assumption in the code that the importing module (which I called the importer in the PR title) URL would be under the file: scheme, but there's no reason this is the case, even without loader it could be under the data: scheme. TBH I'm not sure why we bother converting it to a path instead of exposing the URL and let the user decides if they want to convert it to a path, but for the sake of not introducing a breaking change, I'm simply wrapping the fileURLToPath in a try/catch block.

@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 Oct 20, 2024
Copy link
Contributor

@JakobJingleheimer JakobJingleheimer left a comment

Choose a reason for hiding this comment

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

🙌

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 20, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 20, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

Attention: Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.

Project coverage is 88.41%. Comparing base (b0ffe9e) to head (1722d93).

Files with missing lines Patch % Lines
lib/internal/modules/esm/resolve.js 80.95% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55471      +/-   ##
==========================================
- Coverage   88.42%   88.41%   -0.01%     
==========================================
  Files         653      653              
  Lines      187498   187516      +18     
  Branches    36100    36106       +6     
==========================================
+ Hits       165791   165798       +7     
- Misses      14957    14968      +11     
  Partials     6750     6750              
Files with missing lines Coverage Δ
lib/internal/modules/esm/resolve.js 96.32% <80.95%> (-0.22%) ⬇️

... and 29 files with indirect coverage changes

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the fast-track PRs that do not need to wait for 48 hours to land. label Oct 20, 2024
Copy link
Contributor

Fast-track has been requested by @aduh95. Please 👍 to approve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. esm Issues and PRs related to the ECMAScript Modules implementation. fast-track PRs that do not need to wait for 48 hours to land. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants