oven-sh/bun · error · bun_ast::Error
ModuleNotFound
Error message
ModuleNotFound
What it means
Sentinel thiserror variant used by the AST crate when a module specifier could not be resolved to a file. It marks resolution failure during parsing/linking; the display text is a bare machine-readable tag rather than a human message.
Solutions
- Verify the import specifier and that the package is installed
- Check tsconfig/jsconfig path mappings affecting resolution
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/ast/error.rs:7 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/89aeb3a4b605f9fe.
Report an issue: GitHub.
Appendix: source
Thrown at src/ast/error.rs:7
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
pub enum Error {
#[error("Clobber")]
Clobber,
#[error("SyntaxError")]
SyntaxError,
#[error("ModuleNotFound")]
ModuleNotFound,
#[error(transparent)]
Alloc(#[from] bun_alloc::AllocError),
}
impl Error {
#[allow(clippy::trivially_copy_pass_by_ref)]
pub fn name(&self) -> &'static str {
match self {
Self::Clobber => "Clobber",
Self::SyntaxError => "SyntaxError",
Self::ModuleNotFound => "ModuleNotFound",
Self::Alloc(_) => "OutOfMemory",
}
}
}
impl bun_core::output::ErrName for Error {View on GitHub (pinned to 8c5296ac45)