oven-sh/bun · error · bun_bundler::Error
CompilationFailed
CompilationFailed
Error message
CompilationFailed
What it means
Sentinel meaning a source file failed to compile (parse/transpile returned a hard error), so the chunk containing it cannot be produced. Distinguished from BuildFailed as a per-file compilation fault.
Solutions
- Fix the syntax/feature error reported for the named source file
- Check the loader assigned to the file extension matches its content
- Bun-version pinning or excluding the file via config may help for unsupported syntax
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at src/bundler/error.rs:9 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/47ca1f6676fa3ebb.
Report an issue: GitHub.
Appendix: source
Thrown at src/bundler/error.rs:9
#[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")]
InvalidJSON,
#[error("Fail")]
Fail,
#[error("ParserError")]View on GitHub (pinned to 8c5296ac45)