oven-sh/bun · error · bun_bundler::Error
ModuleNotFound
ModuleNotFound
Error message
ModuleNotFound
What it means
Sentinel variant for a bundler resolution failure: an import/require specifier could not be resolved to a file on disk. It is usually surfaced to the user as a resolve message with path and location, not as this bare string.
Solutions
- Check the specifier spelling, relative path, and file extension
- Install the missing package or add it to package.json dependencies
- Verify tsconfig paths/aliases if using non-relative imports
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/bundler/error.rs:5 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/3669e3e5938c4405.
Report an issue: GitHub.
Appendix: source
Thrown at src/bundler/error.rs:5
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
pub enum Error {
#[error("InvalidRecordKind")]
InvalidRecordKind,
#[error("ModuleNotFound")]
ModuleNotFound,
#[error("BuildFailed")]
BuildFailed,
#[error("CompilationFailed")]
CompilationFailed,
#[error("Plugin")]
Plugin,
#[error("InvalidCssImport")]
InvalidCssImport,
#[error("PrintError")]
PrintError,
#[error("WriteFailed")]
WriteFailed,
#[error("DuplicateOutputPath")]
DuplicateOutputPath,
#[error("MultipleOutputFilesWithoutOutputDir")]
MultipleOutputFilesWithoutOutputDir,
#[error("InvalidJSON")]View on GitHub (pinned to 8c5296ac45)