Skip to content

Fix Vercel build (exit 127): use engine version for the cache dir, not md5sum - #7

Merged
wudidapaopao merged 1 commit into
mainfrom
fix-vercel-build
Jul 1, 2026
Merged

wudidapaopao merged 1 commit into
mainfrom
fix-vercel-build

Conversation

@wudidapaopao

@wudidapaopao wudidapaopao commented Jul 1, 2026 •

Copy link
Copy Markdown
Collaborator

The Vercel deploy failed with Command "bash scripts/build-vercel.sh" exited with 127.
Cause: the build image doesn't ship md5sum, which the content-hash step relied on.

Since chdb-wasm is pinned (0.2.0) and npm versions are immutable, the package version
already identifies the engine bytes. Use it as the cache-busting dir name (dist-<version>),
computed with node (always present in a Vercel build). A new engine version → new dir →
fresh fetch, same as before.

Verified locally: builds out/dist-0.2.0/ (mt only) and rewrites index.html.

🤖 Generated with Claude Code

Note

Fix Vercel build exit 127 by deriving cache dir version from package.json instead of md5sum

The Vercel build was failing with exit code 127 because md5sum is unavailable in the build environment. scripts/build-vercel.sh now computes VER using node -pe to read .version from package.json, prefixed with dist-, replacing the previous md5sum hash of engine artifacts.

📊 Macroscope summarized be27817. 1 file reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

…d5sum

The Vercel build image doesn't ship `md5sum`, so `build-vercel.sh` failed with exit 127
at the content-hash step. Since chdb-wasm is pinned (npm versions are immutable), the
package version fully identifies the engine bytes — use it as the cache-busting dir name,
computed with node (always present in the build) instead of md5sum.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wudidapaopao
wudidapaopao merged commit 8df2ced into main Jul 1, 2026
3 checks passed
Comment thread scripts/build-vercel.sh
# the version fully identifies the engine bytes: a new engine => new version => new dir =>
# fresh fetch, with no stale-cache risk. Computed with node (always present in a Vercel
# build) rather than md5sum, which the build image does not ship.
VER="dist-$(node -pe "JSON.parse(require('fs').readFileSync('$(dirname "$DIST")/package.json','utf8')).version")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium scripts/build-vercel.sh:32

Line 32 reads package.json from $(dirname "$DIST") to compute VER, but when $DIST is a standalone asset directory like ./dist, dirname resolves to . and the script reads this repo's unrelated package.json (yielding 0.0.0) or throws ENOENT when no parent package.json exists. This produces the wrong cache-busting directory or aborts the build for non-default invocations, breaking the [dist-dir] argument that the previous implementation supported.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @scripts/build-vercel.sh around line 32:

Line 32 reads `package.json` from `$(dirname "$DIST")` to compute `VER`, but when `$DIST` is a standalone asset directory like `./dist`, `dirname` resolves to `.` and the script reads this repo's unrelated `package.json` (yielding `0.0.0`) or throws `ENOENT` when no parent `package.json` exists. This produces the wrong cache-busting directory or aborts the build for non-default invocations, breaking the `[dist-dir]` argument that the previous implementation supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant