{"record":{"id":"0305c36b9dfb67e4","repo":"oven-sh/bun","slug":"failed-to-initialize-client-transpiler","errorCode":null,"errorMessage":"Failed to initialize client transpiler: {}","messagePattern":"Failed to initialize client transpiler: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/bundler/bundle_v2.rs","lineNumber":255,"sourceCode":"\n    pub(crate) fn transpiler_for_target(&mut self, target: options::Target) -> &mut Transpiler<'a> {\n        // SAFETY: all three pointers are live for `'a` (set in `init`); the\n        // `client_transpiler` arm is only reached when bake populated it.\n        // Outside of server-components / dev-server,\n        // the only case that doesn't return the main transpiler is a\n        // browser-target request from a server-side build, which lazily\n        // spins up a client transpiler.\n        if !self.transpiler.options.server_components && self.linker.dev_server.is_none() {\n            if target == Target::Browser && self.transpiler.options.target.is_server_side() {\n                if let Some(p) = self.client_transpiler {\n                    // SAFETY: client_transpiler is live for `'a` (set in `init`);\n                    // pointer carries write provenance (constructed from `&mut`\n                    // / `NonNull::from(&mut _)`), and `&mut self` excludes any\n                    // overlapping `client_transpiler_ref()` borrow.\n                    return unsafe { p.assume_mut() };\n                }\n                return self.initialize_client_transpiler().unwrap_or_else(|e| {\n                    panic!(\"Failed to initialize client transpiler: {}\", e.name())\n                });\n            }\n            return &mut *self.transpiler;\n        }\n        // SAFETY: all three pointers are live for `'a` (set in `init`); the\n        // `client_transpiler` arm is only reached when bake populated it.\n        unsafe {\n            match target {\n                Target::Browser => self.client_transpiler.unwrap().assume_mut(),\n                Target::ServerComponentsSsr => &mut *self.ssr_transpiler,\n                _ => &mut *self.transpiler,\n            }\n        }\n    }\n\n    // draft `on_parse_task_complete` / `deinit_without_freeing_arena`\n    // removed — canonical bodies live in the later impl blocks below.\n}","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/bundler/bundle_v2.rs#L237-L273","documentation":"In transpiler_for_target, a browser-target request during a server-side build (server components or dev server) lazily creates a dedicated client transpiler. Initializing that client transpiler failed, so no browser-target compilation can proceed for this request; the underlying reason is interpolated.","triggerScenarios":"Thrown at src/bundler/bundle_v2.rs:255 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the interpolated cause (usually OOM or an options error) and fix it","Retry the dev-server request after the underlying issue is resolved","If it persists, simplify the server/client split configuration in your bake setup"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","contentChangedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}