Skip to content

Commit 746a449

Browse files
authored
chore(deps): upgrade next to 16.3.1, its optimizer no longer deletes live code (#6777)
* chore(deps): upgrade next to 16.3.1, its optimizer no longer deletes live code 16.3.0 was reverted in #6242 because its Turbopack optimizer modelled a bare `return <asyncCall>()` tail call inside an async function as returning the promise object, propagated that always-truthy fact through the caller's `await`, and deleted everything after the resulting `if`. That shipped two dead code paths to production: the whole `POST /api/credentials` create path, and the insert inside `upsertAsyncToolCall`. We reported it as vercel/next.js#96595. The fix — "[turbopack] Collapse nested promises in the analyzer" (vercel/next.js#96601) — folds `Promise<Promise<T>>` to `Promise<T>` in the analyzer, and was backported as #96675 and released in 16.3.1. Verified before taking the bump: - The minimal reproduction from the issue no longer reproduces on 16.3.1. All four routes keep their code; on 16.3.0 `/api/broken` lost everything after the `if`. - A production build of `apps/sim` on 16.3.1 still emits the markers whose disappearance was the original signal: `credential_connected` (43 files), `acquireOrganizationUserMutationLocks` (28), and the `upsertAsyncToolCall` insert-path warning (10). The `return await` hardening added to both sites in the revert stays as is, and so does the TypeScript toolchain configuration. 16.3.1 published 2026-08-13, so it is inside the 7-day `minimumReleaseAge` supply-chain window until 2026-08-20 and needs an exclusion to install. The alternative is sitting on 16.2.12, whose successor we already reverted once, so the entries go in dated and come out on the next touch of the file. The mermaid and js-yaml exclusions aged out on 2026-08-11 and 2026-08-07 and are dropped here per that same rule. * fix(deps): keep the musl and win32 SWC binaries in the lockfile The release-age exclusion only listed the four @next/swc platforms that package.json pins, but next declares all eight as its own optionalDependencies, so all eight are normally resolved into bun.lock. A gated optional dependency does not fail the install — bun drops it silently — so the first install stripped both musl variants and both win32 variants from the lockfile. That left the Alpine devcontainer and any Windows machine with no SWC binary to resolve. Adding the remaining four to the exclusion list restores all eight entries at 16.3.1. Worth knowing for the next time this happens: bun.lock is sticky here. Once an optional dependency has been dropped, re-running the install — even with --force, even with the age gate switched off entirely — does not bring it back, because the resolution is not reattempted. The lockfile has to be regenerated from a base that still contains the entries, which is why this restores bun.lock from staging before re-applying the bump.
1 parent 5d172b4 commit 746a449

7 files changed

Lines changed: 60 additions & 95 deletions

File tree

apps/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"fumadocs-mdx": "14.3.2",
2828
"fumadocs-openapi": "10.8.1",
2929
"fumadocs-ui": "16.8.5",
30-
"next": "16.2.12",
30+
"next": "16.3.1",
3131
"next-themes": "^0.4.6",
3232
"react": "19.2.4",
3333
"react-dom": "19.2.4",

apps/sim/next.config.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,15 @@ const nextConfig: NextConfig = {
218218
* it lives. Restoring across commits is separately undocumented-as-supported
219219
* (vercel/next.js#87283 reports stale HTML from a cache built elsewhere).
220220
*
221-
* Keep the explicit pin even while we sit on 16.2.12: 16.3.0 flips this
222-
* default to true for stable (vercel/next.js#94616), so dropping it would
223-
* silently re-enable the slower cache the next time we take that bump.
221+
* The explicit pin is load-bearing: 16.3.0 flipped this default to true for
222+
* stable (vercel/next.js#94616), so dropping it re-enables the slower cache.
224223
*/
225224
turbopackFileSystemCacheForBuild: false,
226225
/**
227226
* TypeScript 7 ships no JavaScript compiler API until 7.1, so Next's default
228227
* checker cannot load it — this shells out to the project-local `tsc` instead.
229228
* Pinned because the failure mode is not slower type checking but none at all:
230-
* without it 16.2.12 skips the stage silently in 138ms.
229+
* 16.2.12 skipped the stage silently in 138ms.
231230
*/
232231
useTypeScriptCli: true,
233232
preloadEntriesOnStart: false,

apps/sim/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
"mssql": "12.7.0",
196196
"mysql2": "3.14.3",
197197
"neo4j-driver": "6.0.1",
198-
"next": "16.2.12",
198+
"next": "16.3.1",
199199
"next-mdx-remote": "^6.0.0",
200200
"next-runtime-env": "3.3.0",
201201
"next-themes": "^0.4.6",

bun.lock

Lines changed: 20 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bunfig.toml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,34 @@ exact = true
55
minimumReleaseAge = 604800
66
# @typescript/native-preview stays excluded permanently: it only publishes nightly
77
# dev builds, so every version is structurally younger than any age gate.
8-
# mermaid 11.16.1 (published 2026-08-04) clears five open Dependabot advisories that
9-
# 11.15.0 carries: architecture-diagram and config-API prototype pollution, radar and
10-
# XY-chart DoS, and CSS injection into siblings of the diagram. It is inside the 7-day
11-
# window and cannot be installed without an exception; it ages out on 2026-08-11 — drop
12-
# the entry then, and re-date this note on any further bump rather than deleting the entry
13-
# early, because removing it while the pinned version is still inside the window blocks the
14-
# bump outright. js-yaml 4.3.1 (published 2026-07-31) carries the CVE-2026-59870 !!omap
15-
# quadratic-CPU fix, which was never backported to the 4.3.0 line; it ages out on 2026-08-07,
16-
# so that entry can go on the next touch of this file.
17-
minimumReleaseAgeExcludes = ["@typescript/native-preview", "mermaid", "js-yaml"]
8+
# next 16.3.1 (published 2026-08-13) carries the Turbopack fix for vercel/next.js#96595,
9+
# the dead-code elimination bug that deleted the POST /api/credentials create path in
10+
# production and forced the 16.3.0 revert (#6242). Sitting on 16.2.12 to wait out the
11+
# window means knowingly staying on a release whose successor we already reverted once,
12+
# so the bump takes an exception instead. It ages out on 2026-08-20 — drop these entries
13+
# then, and re-date this note on any further bump rather than deleting them early, because
14+
# removing an entry while its pinned version is still inside the window blocks the bump
15+
# outright. The mermaid and js-yaml entries aged out on 2026-08-11 and 2026-08-07 and are
16+
# dropped here per that rule.
17+
# All eight @next/swc platform packages are listed even though package.json pins only four:
18+
# next declares all eight as its own optionalDependencies, so every one of them is resolved
19+
# into bun.lock regardless of which host runs the install. A gated optional dependency does
20+
# not fail the install — bun drops it silently — so omitting the musl and win32 entries here
21+
# would quietly strip them from the lockfile, and the Alpine devcontainer and any Windows
22+
# machine would then have no SWC binary to resolve.
23+
minimumReleaseAgeExcludes = [
24+
"@typescript/native-preview",
25+
"next",
26+
"@next/env",
27+
"@next/swc-darwin-arm64",
28+
"@next/swc-darwin-x64",
29+
"@next/swc-linux-arm64-gnu",
30+
"@next/swc-linux-arm64-musl",
31+
"@next/swc-linux-x64-gnu",
32+
"@next/swc-linux-x64-musl",
33+
"@next/swc-win32-arm64-msvc",
34+
"@next/swc-win32-x64-msvc",
35+
]
1836

1937
[run]
2038
env = { NEXT_PUBLIC_APP_URL = "http://localhost:3000" }

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
9797
"overrides": {
9898
"react": "19.2.4",
9999
"react-dom": "19.2.4",
100-
"next": "16.2.12",
101-
"@next/env": "16.2.12",
100+
"next": "16.3.1",
101+
"@next/env": "16.3.1",
102102
"drizzle-orm": "^0.45.2",
103103
"postgres": "^3.4.5",
104104
"minimatch": "^10.2.5",
@@ -107,10 +107,10 @@
107107
"e2b": "^2.36.1"
108108
},
109109
"optionalDependencies": {
110-
"@next/swc-darwin-arm64": "16.2.12",
111-
"@next/swc-darwin-x64": "16.2.12",
112-
"@next/swc-linux-arm64-gnu": "16.2.12",
113-
"@next/swc-linux-x64-gnu": "16.2.12"
110+
"@next/swc-darwin-arm64": "16.3.1",
111+
"@next/swc-darwin-x64": "16.3.1",
112+
"@next/swc-linux-arm64-gnu": "16.3.1",
113+
"@next/swc-linux-x64-gnu": "16.3.1"
114114
},
115115
"devDependencies": {
116116
"@babel/parser": "7.29.2",

packages/emcn/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"class-variance-authority": "^0.7.1",
8383
"framer-motion": "^12.5.0",
8484
"input-otp": "^1.4.2",
85-
"next": "16.2.12",
85+
"next": "16.3.1",
8686
"prismjs": "^1.30.0",
8787
"react": "19.2.4",
8888
"react-dom": "19.2.4",

0 commit comments

Comments
 (0)