Skip to content

Comments

fix: Switch Docker build stage from Bun to Node.js (PR #355 CI fix)#356

Closed
github-actions[bot] wants to merge 1 commit intofeat/api-docs-summaryfrom
claude-fix-pr-355-20300261542
Closed

fix: Switch Docker build stage from Bun to Node.js (PR #355 CI fix)#356
github-actions[bot] wants to merge 1 commit intofeat/api-docs-summaryfrom
claude-fix-pr-355-20300261542

Conversation

@github-actions
Copy link
Contributor

CI Auto-Fix

Original PR: #355
Failed CI Run: Non-Main Branch CI/CD #20300261542


Problem

The Docker build failed with a native module incompatibility error:

TypeError: symbol 'napi_register_module_v1' not found in native module. 
Is this a Node API (napi) module?
    at <anonymous> (next.config.compiled.js:12:63)
error: script "build" exited with code 1

Root Cause: Bun runtime has incomplete N-API support for native Node.js modules. The next-intl/plugin dependency (used in next.config.ts) requires full N-API compatibility that Bun doesn't provide yet.


Solution

Switch the Docker build stage from oven/bun:slim to node:22-slim:

Change Before After
Build base image oven/bun:slim node:22-slim
Dependency install bun install npm install --production=false
Build command bun run build npm run build
Runtime stage node:22-slim (unchanged) node:22-slim (unchanged)

Fixes Applied

File Change Type Description
deploy/Dockerfile Build system Replace Bun with Node.js for build stage (lines 3, 8, 27)

Impact Assessment

No runtime behavior changes - Runtime stage already uses Node.js
No dependency changes - Same packages, just different build tool
Build reliability improved - Full N-API compatibility ensured
⚠️ Build time may increase slightly - npm is slower than Bun for installs


Verification Checklist

  • Dockerfile syntax is valid
  • Build stage uses Node.js 22-slim
  • Runtime stage unchanged (Node.js 22-slim)
  • No logic or functionality changes
  • Minimal scope (only Dockerfile modified)

Alternative Approaches Considered

Approach Why Not Chosen
Update Bun version N-API support still incomplete in latest Bun
Remove next-intl Would break internationalization features
Use Bun for runtime too Would risk production runtime issues

Auto-generated by Claude AI - Safe mechanical fix only

…ompatibility

Fixed:
- Replace Bun with Node.js 22-slim for build-base stage
- Change 'bun install' to 'npm install --production=false'
- Change 'bun run build' to 'npm run build'

Root Cause:
Bun has incomplete N-API support for native modules used by next-intl/plugin,
causing 'symbol napi_register_module_v1 not found' error during Next.js build.

Solution:
Use Node.js for the build stage to ensure full N-API compatibility while
maintaining Node.js for the runtime stage (no behavior changes).

CI Run: https://github.com/ding113/claude-code-hub/actions/runs/20300261542
@NightYuYyy NightYuYyy deleted the branch feat/api-docs-summary December 18, 2025 09:10
@NightYuYyy NightYuYyy closed this Dec 18, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Claude Code Hub Roadmap Dec 18, 2025
@ding113 ding113 deleted the claude-fix-pr-355-20300261542 branch December 23, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant