fix(deploy): unstick nitro Json typecheck and wipe poisoned .next cache
Local Build and Deploy / deploy (push) Failing after 1m21s

Host next build still saw Json on nitro while tsc passed; use any helpers, verify blob hash, and delete .next entirely before build.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-07-18 20:14:50 +02:00
1 parent 1abbf3fde7
commit 968f6ff7db
3 files changed
+57 -78

No files matched your search

+17 -2
View File
@@ -66,12 +66,27 @@ jobs:
git diff --exit-code -- src
fi
# Prove critical sources match the git object (not just index timestamps).
NITRO_SRC="src/app/admin/import/furni/nitro-editor-dialog.tsx"
NITRO_EXPECTED="$(git rev-parse "HEAD:${NITRO_SRC}")"
NITRO_ACTUAL="$(git hash-object "${NITRO_SRC}")"
echo "nitro-editor-dialog blob expected=${NITRO_EXPECTED} actual=${NITRO_ACTUAL}"
if [ "${NITRO_EXPECTED}" != "${NITRO_ACTUAL}" ]; then
echo "ERROR: ${NITRO_SRC} content hash mismatch after checkout" >&2
exit 1
fi
if grep -nE '(^|[[:space:]])type Json\b|:\s*Json\b' "${NITRO_SRC}"; then
echo "ERROR: ${NITRO_SRC} still has a Json type annotation after checkout" >&2
exit 1
fi
# Drop incremental TS caches that can hide real type errors.
rm -f tsconfig.tsbuildinfo .tsbuildinfo
find . -maxdepth 3 -name '*.tsbuildinfo' -delete 2>/dev/null || true
# Preserve .next/cache so Next.js can reuse its incremental build cache.
rm -rf .output dist .next/types .next/dev
# Wipe .next entirely — partial cache has caused next build TS to disagree
# with a clean `tsc` on the same sources (stale nitro/rooms typings).
rm -rf .output dist .next
# Release tag for Sentry / logs (short git sha)
export APP_VERSION="$(git rev-parse --short HEAD)"