Files
bun.sh/src/resolver
Claude Bot 9386d63daa Improve error messages when package exports point to missing files
When a package's exports field resolves to a file that doesn't exist,
show the resolved file path in the error message instead of just
"Cannot find package 'X'". This helps users understand whether the
issue is a missing package or a build configuration problem.

Before:
  error: Cannot find package 'stripe' from '/app/index.mjs'

After:
  error: Cannot find module "/app/node_modules/stripe/esm/stripe.esm.worker.js" imported from "/app/index.mjs"

This matches Node.js behavior and makes it clear that:
1. The package was found
2. The exports resolved to a specific file
3. That specific file doesn't exist (likely a bundler/build issue)

Fixes: https://github.com/oven-sh/bun/issues/24848

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 04:43:42 +00:00
..
2025-11-10 14:38:26 -08:00