diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index 544fc8c0..80255c4a 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -40,6 +40,7 @@ for (const [os, arch] of targets) { await $`tar -xf ../../node_modules/${watcher.replace("@parcel/", "parcel-")}-*.tgz -C ../../node_modules/${watcher} --strip-components=1` await Bun.build({ + sourcemap: true, compile: { target: `bun-${os}-${arch}` as any, outfile: `dist/${name}/bin/opencode`, diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts index 525944c0..b8d36214 100644 --- a/packages/opencode/src/index.ts +++ b/packages/opencode/src/index.ts @@ -129,7 +129,10 @@ try { Log.Default.error("fatal", data) const formatted = FormatError(e) if (formatted) UI.error(formatted) - if (formatted === undefined) UI.error("Unexpected error, check log file at " + Log.file() + " for more details") + if (formatted === undefined) { + UI.error("Unexpected error, check log file at " + Log.file() + " for more details\n") + console.error(e) + } process.exitCode = 1 }