Skip to content

Conversation

@arcanis
Copy link
Member

@arcanis arcanis commented Nov 6, 2025

What's the problem this PR addresses?

Node.js added support for a conditions flag in _resolveFilename (and thus indirectly require.resolve), but they forgot to document this new option. As a result our hook rightfully refuses to perform the resolution since it doesn't know what to do with this flag.

This is more an issue when using the new registerHook API because it then stops going into this codepath, causing a conditions option to always be injected.

Vite recently started using this API as of 7.2.0, so it now crashes.

How did you fix it?

Adds support for the conditions option (we already supported it, it's just that we weren't forwarding it, since Node.js didn't support it).

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis arcanis merged commit 7f63e07 into master Nov 7, 2025
26 checks passed
@arcanis arcanis deleted the mael/conditions-option branch November 7, 2025 08:15
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.

2 participants