GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — fix(deps): revert next to 16.2.12, its 16.3.0 optimizer deletes live code by waleedlatif1 · Pull Request #6242 · simstudioai/sim Conversation
Collaborator
Summary
ScopeBuilt the same commit on 16.2.12 and 16.3.0 and diffed 71,266 distinctive source string literals across Type of Change
Testing
Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
…code Next 16.3.0's Turbopack optimizer models a bare `return <asyncCall>()` tail call inside an async function as returning the promise object, then propagates that always-truthy fact through the caller's `await`. Where the result feeds an `if (x)` whose every branch returns, it concludes the branch is always taken and deletes everything after it from the emitted bundle. Two sites shipped to production that way: - `POST /api/credentials` lost its entire create path — the transaction, the org locks, the insert, the audit, the 201. A first-time create fell into the existing-credential branch and threw on `existingCredential.id`, so every new credential 500'd. - `upsertAsyncToolCall` collapsed to `async () => await getAsyncToolCall(id)`. The insert is simply gone; it returns null for every new async copilot tool call. Silent — no error, no failed request. A differential scan of 71,266 source string literals across `.next/server` and `.next/static`, comparing images built from the same commit on 16.2.12 and 16.3.0, found exactly these two and nothing else. That scan cannot see dropped branches with no distinctive string literal, which is why the version goes back rather than the two sites being patched alone. Both are also hardened with `return await`, verified to defeat the miscompile in a minimal reproduction. The TypeScript toolchain cleanup from the original bump (dropping @typescript/native-preview, `useTypeScriptCli`) is kept.
|
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
PR SummaryHigh Risk Overview Hardening:
Reviewed by Cursor Bugbot for commit 6de3c44. Configure here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Greptile SummaryThis PR consistently reverts Next.js and its associated environment and compiler packages from 16.3.0 to 16.2.12 to avoid a confirmed Turbopack optimizer regression, while retaining explicit compiler workarounds.
Confidence Score: 5/5The PR appears safe to merge; the downgrade is consistent across manifests and the lockfile, and the async hardening preserves existing runtime behavior. The changed dependency graph resolves coherently to Next 16.2.12 across supported build targets, while the explicit awaits preserve transaction, tracing, error, and promise semantics and prevent the reported optimizer failure.
|
| Filename | Overview |
|---|---|
| package.json | Aligns root Next, @next/env, and explicitly installed SWC packages on 16.2.12. |
| bun.lock | Resolves a coherent Next 16.2.12 graph, including matching environment, SWC, PostCSS, and Sharp packages. |
| apps/sim/app/api/credentials/route.ts | Adds explicit awaits to prevent the documented optimizer from deleting the credential creation path. |
| apps/sim/lib/copilot/async-runs/repository.ts | Hardens traced async database wrappers against the same optimizer misclassification without changing runtime contracts. |
| apps/sim/next.config.ts | Retains configuration compatible with 16.2.12 and clarifies why explicit cache and TypeScript CLI settings remain necessary. |
Reviews (1): Last reviewed commit: "fix(deps): revert next to 16.2.12, its 1..." | Re-trigger Greptile
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Picks up the Next 16.2.12 revert (#6242). The earlier merge had taken staging's 16.3.0; this takes the revert in apps/docs, apps/sim and packages/emcn and regenerates the lockfile. lucide-react stays removed.
…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.
6de3c447
Deployed
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.