fix(build): deliver stranded docker-build fixes lost after PR #6 squash merge - #7
Merged
Merged
Conversation
added 4 commits
August 26, 2026 03:23
next@16 verifies the TS toolchain by probing typescript/lib/typescript.js (verify-typescript-setup -> has-necessary-dependencies). typescript@7 is the Go-native port and no longer ships that file, so next build treated typescript as missing and attempted an auto-install, dying with ERR_PNPM_ADDING_TO_ROOT under pnpm workspaces (Docker) or throwing missingDepsError in CI. The postinstall now creates a tiny ESM shim at the probed path that re-exports the package version metadata. Build-time type checking stays disabled via typescript.ignoreBuildErrors, so the classic compiler API is never loaded. Guarded by tests/typescript-detection.test.ts.
loadKeys() ran at module scope, so importing jwt-utils without runtime secrets threw during next build page-data collection (Docker/CI builds have no .env.local): 'Failed to collect page data for /api/wiki/sync'. This was hidden behind the CI build masking workaround. The cache now initializes lazily on first sign/verify call. Fail-fast is preserved: the first token operation still validates JWT_SECRET/JWT_SECRETS.
node_modules/.bin/next is a POSIX shell shim in the pnpm layout; running it with 'node' died with SyntaxError on container start. Invoke next/dist/bin/next (the actual JS entrypoint) instead. This CMD path was never exercisable before because the image build never succeeded.
The '|| exit 0' in the Build job (b3a99e2) converted every build exit 1 into a warning, hiding both the TypeScript detection failure and the JWT module-scope failure. With both root causes fixed, pnpm build exits 0 on its own; the job now fails loudly again on real regressions.
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.
Context
PR #6 was squash-merged at
93d32a9content (repin buildx SHA + Dockerfile pnpm-first + .dockerignore) ase312575. Four commits with the actual root-cause fixes were pushed tofix/ci-buildx-pnpmAFTER the merge and never reached main.Result on main (
e312575):docker buildfails:ERR_PNPM_ADDING_TO_ROOTduringpnpm build(exit 1)Docker Build & Provenance: failureSLSA Provenance(Build & Attest): failureBuild: success only because the|| exit 0masking workaround is still presentWhat this PR does
Cherry-picks the 4 stranded commits (no new code, authorship preserved):
217a3bdscripts/fix-typescript-detection.sh) — root cause of ERR_PNPM_ADDING_TO_ROOT440ceeb4bed31enext/dist/bin/next) — pnpm.binshim crashed at container start9ce9a64Verification
docker build -t amc:verify .on this branch: exit 0 (27s),pnpm buildstep compiled successfullytests/typescript-detection.test.ts+src/lib/jwt-utils.test.ts— 13/13 passedJWT_SECRET+ADMIN_PASSWORD):/api/health200,/login200Card: workboard d3770a95