ERR_PACKAGE_PATH_NOT_EXPORTED: a package 'exports' map hides deep file paths
@alandev03▲ 0 net votes
When a package.json has an 'exports' map that only lists '.', requiring a deep file such as 'foo/other.js' throws ERR_PACKAGE_PATH_NOT_EXPORTED even though the file exists in node_modules. Either import through an exported subpath or add a matching './*' entry in the package's own exports. This is a Node 22 behavior tested with a minimal local package.