Skip to content

Commit 4ae2939

Browse files
committed
fix: add better logging for plugin bundling success/failure
Helps diagnose why bundling might fail in compiled binaries.
1 parent 493ff6c commit 4ae2939

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

packages/opencode/src/bun/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,23 +146,30 @@ export namespace BunProc {
146146
})
147147

148148
if (!result.success) {
149-
log.error("failed to bundle plugin", {
149+
log.error("failed to bundle plugin - falling back to unbundled module", {
150150
pkg,
151151
logs: result.logs,
152+
unbundledPath: mod,
152153
})
153154
// Fall back to unbundled module
154155
return mod
155156
}
156157

158+
log.info("successfully bundled plugin", {
159+
pkg,
160+
bundledFile,
161+
})
162+
157163
// Copy non-JS assets (HTML, CSS, etc.) that plugins may need at runtime
158164
// Some bundled code uses __dirname + ".." to find assets, so copy to both
159165
// the bundled dir and the parent cache dir for compatibility
160166
await copyPluginAssets(mod, bundledDir)
161167
await copyPluginAssets(mod, Global.Path.cache)
162168
} catch (e) {
163-
log.error("failed to bundle plugin", {
169+
log.error("failed to bundle plugin - falling back to unbundled module", {
164170
pkg,
165171
error: (e as Error).message,
172+
unbundledPath: mod,
166173
})
167174
// Fall back to unbundled module
168175
return mod

0 commit comments

Comments
 (0)