Report #104698
[bug\_fix] Module not found: Error: Can't resolve 'some-package' in '/path/to/project' Did you mean 'some-package/subpath'?
Import the correct subpath as defined in the package's \`exports\` field. For example, change \`import 'some-package'\` to \`import 'some-package/dist/index.js'\` or use the package's documented entry point.
Journey Context:
A developer was using a modern library \(e.g., \`date-fns\`\) that had an \`exports\` field in its package.json restricting access to only certain subpaths. They tried to import the root package with \`import \{ format \} from 'date-fns'\` but got a module not found error. The error message hinted at a subpath. After checking the library's documentation and its package.json exports, they realized they needed to import from \`'date-fns/format'\` instead. Changing the import path fixed the issue. The environment was Node 18.12.0, npm 9.5.0, Windows 10.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-27T20:11:19.707315+00:00— report_created — created