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

fix(ext/node): resolve exports even if parent module filename isn't present #26553

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

nathanwhit
Copy link
Member

Fixes #26505

I'm not exactly sure how this case comes about (I tried to write tests for it but couldn't manage to reproduce it), but what happens is the parent filename ends up null, and we bail out of resolving the specifier in package exports.

I've checked, and in node the parent filename is also null (so that's not a bug on our part), but node continues to resolve even in that case. So this PR should match node's behavior more closely than we currently do.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM. For a test it looks like you can use runMain in node:module

@nathanwhit nathanwhit force-pushed the require-no-parent-filename branch from 4057421 to 3281108 Compare October 30, 2024 19:47
@nathanwhit nathanwhit merged commit 6d44952 into denoland:main Oct 31, 2024
17 checks passed
@nathanwhit nathanwhit deleted the require-no-parent-filename branch October 31, 2024 17:02
bartlomieju pushed a commit that referenced this pull request Nov 5, 2024
…resent (#26553)

Fixes #26505

I'm not exactly sure how this case comes about (I tried to write tests
for it but couldn't manage to reproduce it), but what happens is the
parent filename ends up null, and we bail out of resolving the specifier
in package exports.

I've checked, and in node the parent filename is also null (so that's
not a bug on our part), but node continues to resolve even in that case.
So this PR should match node's behavior more closely than we currently
do.
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.

NextJS 15's new next.config.ts breaks when using Deno
3 participants