Skip to content

Conversation

@vidschofelix
Copy link
Contributor

@vidschofelix vidschofelix commented Nov 12, 2025

Moved the "node" and "react-native" export definitions lower in the exports map.
This fixes the "No known conditions for './node' specifier" error.

Moved the "node" and "react-native" export definitions lower in the exports map.
This fixes the "No known conditions for './node' specifier" error (mswjs#2545)
@kettanaito kettanaito changed the title fix: reorder exports fix(react-native): move node and react-native export conditions lower Nov 14, 2025
@kettanaito kettanaito changed the title fix(react-native): move node and react-native export conditions lower fix(node): move browser and react-native export conditions lower Nov 14, 2025
"types": "./lib/node/index.d.mts",
"default": "./lib/node/index.mjs"
},
"browser": null,
Copy link
Member

Choose a reason for hiding this comment

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

I'm just worried that some browser environments might false-positively match some of the preceding conditions, like module.

@markerikson, hi! Sorry for a direct ping. May I ask for your wisdom on this change? Do you see any unexpected behaviors this would cause for browsers importing the /node path?

Choose a reason for hiding this comment

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

I'm actually not sure I've seen use of a null value for a condition before, but then again I also stopped trying to think about this after we got the RTK packages in shape :)

I don't have a good answer here, but looking at the issue thread it sounds like this helps. Worth a shot?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! Appreciate your input. I also no see any dangers with this, so release it is!

Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this, @vidschofelix 🚀

@kettanaito kettanaito merged commit 102d85a into mswjs:main Nov 14, 2025
19 of 20 checks passed
@kettanaito
Copy link
Member

Released: v2.12.2 🎉

This has been released in v2.12.2.

Get these changes by running the following command:

npm i msw@latest

Predictable release automation by Release.

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.

"No known conditions for "./node" specifier in "msw/node" package" in Svelte Testing Library

3 participants