Problem Description
When resolving b/c/d from fixtures/abc/node_modules/a/index.js:
- Expected: Should resolve to
fixtures/abc/node_modules/b/c/d.js
- Actual: Returns
Err(NotFound("b/c/d"))
Directory Structure
fixtures/abc/node_modules/
├── a/
│ └── index.js # import x from 'b/c/d'
└── b/
├── package.json # { "name": "b", "main": "index.js" }
└── c/
├── d.js # expected resolution target
└── d/
└── e.js
Analysis
This is a subpath resolution issue. When resolving b/c/d:
b is the package name, should locate node_modules/b first
c/d is the subpath within the package, should resolve to b/c/d.js
The resolver fails to correctly resolve package subpaths (e.g., package-name/path/to/file) when there is no exports field in package.json. It should fall back to filesystem-based resolution within the package directory, but currently returns NotFound.
Problem Description
When resolving
b/c/dfromfixtures/abc/node_modules/a/index.js:fixtures/abc/node_modules/b/c/d.jsErr(NotFound("b/c/d"))Directory Structure
Analysis
This is a subpath resolution issue. When resolving
b/c/d:bis the package name, should locatenode_modules/bfirstc/dis the subpath within the package, should resolve tob/c/d.jsThe resolver fails to correctly resolve package subpaths (e.g.,
package-name/path/to/file) when there is no exports field in package.json. It should fall back to filesystem-based resolution within the package directory, but currently returnsNotFound.