Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './x' is not defined by "exports"
You imported a deep path inside a package that its package.json "exports" field doesn’t expose.
Seen on:
Node.js
Meaning
Packages with an exports map hide internal files. Deep imports that worked before an upgrade break, and old tooling (e.g. old webpack/postcss) may request unexported paths.
Common causes
- Deep import into a package’s internals
- Package upgraded and changed its exports
- Old tool incompatible with the new package version
⚡ Quick fix
- Import from the documented public entry point
- Upgrade the tool that does the deep import
- Pin the previous package version if necessary
Detailed fix by platform
Node.js
- Check the package's package.json "exports" to see allowed subpaths
How to diagnose
- Path — Which subpath?
- Exports — What does the package expose?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026