Repository navigation
Fix Vercel build (exit 127): use engine version for the cache dir, not md5sum - #7
Merged
Merged
Conversation
…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>
| # 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")" |
There was a problem hiding this comment.
🟡 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-wasmis pinned (0.2.0) and npm versions are immutable, the package versionalready 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 rewritesindex.html.🤖 Generated with Claude Code
Note
Fix Vercel build exit 127 by deriving cache dir version from
package.jsoninstead ofmd5sumThe Vercel build was failing with exit code 127 because
md5sumis unavailable in the build environment. scripts/build-vercel.sh now computesVERusingnode -peto read.versionfrompackage.json, prefixed withdist-, replacing the previousmd5sumhash of engine artifacts.📊 Macroscope summarized be27817. 1 file reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.