Symptom
A Turbopack production or dev build of an App Router route handler with export const runtime = 'edge' fails when cacheHandlers is configured. The pull request names edge-app-route.js: Expected ';', '}' or <eof>. next build --webpack of the same app succeeds.
Evidence what you'll see
- The linked issue does not give that parser line. Its report is that
pnpm buildfails andpnpm next build --webpacksucceeds, onnext16.5.0-canary.4. - The failure was introduced when cache handlers were wired into edge paths. The existing edge fixture set only
cacheHandler, notcacheHandlers, so the Turbopack loop never ran for an edge route. - Webpack emits assignment statements at the
edgeCacheHandlersRegistrationinjection point. Turbopack emitted object-literal property fragments, which do not parse at statement position afterconst edgeCacheHandlers = {}.
Why it happens
Turbopack's wrap_edge_route filled a statement-position slot with object-literal fragments. Pull request 100046 emits one assignment per configured kind (edgeCacheHandlers[<kind>] = cacheHandlerN), matching the webpack loader.
Affected versions
Linux x64, Node 24.14.1, pnpm 12.10.1, next 16.5.0-canary.4, React 19.3.0. Reproduction: https://github.com/oskari/next-bug-repros/tree/main/edge-route-cache-handlers.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
next buildwith Turbopack completes for an edge route handler whencacheHandlersis set, withoutExpected ';', '}' or <eof>.
If it still fails
- No published non-prerelease tag contains pull request 100046. Tag
v16.4.2was compared against mergec420af2254deand does not contain it. - Prerelease canary tags are not used as the Fixed badge.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it