Skip to content

Commit 9320065

Browse files
fix(web): enable Next.js version skew protection during rolling deploys (#1346)
* fix(web): enable Next.js version skew protection during rolling deploys Set `deploymentId` from the commit sha already baked in at build time (NEXT_PUBLIC_BUILD_COMMIT_SHA). Next.js stamps static asset URLs with ?dpl=<sha> and, on a deployment-id mismatch during navigation, does a full reload instead of fetching chunks from a build that's no longer serving — fixing the "Failed to load chunk" error users hit while the pod is updating. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: add CHANGELOG entry for version skew protection Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5bd62b3 commit 9320065

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
- Upgraded `protobufjs` to `^7.6.4`. [#1336](https://github.com/sourcebot-dev/sourcebot/pull/1336)
2222
- Upgraded `tar` to `^7.5.16`. [#1338](https://github.com/sourcebot-dev/sourcebot/pull/1338)
2323
- Upgraded `esbuild` to `^0.28.1`. [#1342](https://github.com/sourcebot-dev/sourcebot/pull/1342)
24+
- Enabled Next.js version skew protection to fix "Failed to load chunk" errors during rolling deploys. [#1346](https://github.com/sourcebot-dev/sourcebot/pull/1346)
2425

2526
## [5.0.3] - 2026-06-17
2627

packages/web/next.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import { withSentryConfig } from "@sentry/nextjs";
55
const nextConfig = {
66
output: "standalone",
77

8+
// Version skew protection for rolling deploys.
9+
// @see: https://nextjs.org/docs/app/guides/self-hosting#version-skew
10+
deploymentId: process.env.NEXT_PUBLIC_BUILD_COMMIT_SHA,
11+
812
// This is required when using standalone builds.
913
// @see: https://env.t3.gg/docs/nextjs#create-your-schema
1014
transpilePackages: ["@t3-oss/env-core"],

0 commit comments

Comments
 (0)