-
-
Notifications
You must be signed in to change notification settings - Fork 256
Description
Context
What's your version of nuqs?
"nuqs": "^2.4.3"
What framework are you using?
✅ React SPA (no router)
✅ React Router
Which version of your framework are you using?
"react": "19.0.0"
"react-dom": "19.0.0"
"react-router": "7.1.5"
Description
The package.json file is not currently listed in the "exports" field of this package.
In other libraries, the package.json file is explicitly exported, e.g.:
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./esm-only.cjs"
}
}
This omission is causing compatibility problems when using Vite Module Federation.
Module Federation’s internal logic attempts to read the package.json path from the library’s exports. In certain cases—especially when the package.json might be located differently in other libraries—it expects the ./package.json entry to exist. Without it, it fails to resolve correctly.
Steps to Reproduce
Install this package in a Vite project configured with Module Federation.
Attempt to load the package via Module Federation.
Observe resolution errors due to missing package.json export.
Expected Behavior
The package should define ./package.json in the exports map so that Module Federation (and other tools) can correctly resolve it.
Proposed Solution
Add the following to the exports field in package.json:
"exports": {
"./package.json": "./package.json",
// ... other exports
}