Skip to content

Commit e9308b4

Browse files
committed
fix(web): externalize code-map and esbuild to fix Render build
- Remove code-map re-export from SDK index.ts (web doesnt need it) - Add webpack externals for @codebuff/code-map and esbuild - Fixes WASM module parsing errors during Next.js build
1 parent ddd6ac7 commit e9308b4

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

sdk/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ export { buildUserMessageContent } from '../../packages/agent-runtime/src/util/m
1919
export type { AgentDefinition } from '../../common/src/templates/initial-agents-dir/types/agent-definition'
2020
export type { ToolName } from '../../common/src/tools/constants'
2121

22-
// Re-export code analysis functionality
23-
export * from '../../packages/code-map/src/index'
24-
2522
export type {
2623
ClientToolCall,
2724
ClientToolName,

web/next.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ const nextConfig = {
3535
'async_hooks',
3636
)
3737

38+
// Externalize code-map package to avoid bundling tree-sitter WASM files
39+
// The web app doesn't need code-map functionality (only SDK CLI tools do)
40+
config.externals.push(
41+
'@codebuff/code-map',
42+
'@codebuff/code-map/parse',
43+
'@codebuff/code-map/languages',
44+
/^@codebuff\/code-map/,
45+
'esbuild', // Used by SDK's load-agents.ts
46+
)
47+
3848
// Suppress contentlayer webpack cache warnings
3949
config.infrastructureLogging = {
4050
level: 'error',

0 commit comments

Comments
 (0)