Patch Changes
-
#1361
8c31fbcThanks @vicb! - chore: bump@opennextjs/awsto 4.1.1See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v4.1.1
-
#1359
65e4487Thanks @vicb! - chore: bump the Next.js peer dependency to 15.5.24 / 16.3.3 -
#1359
65e4487Thanks @vicb! - fix: patch the Turbopack wasm helpers that Next.js 16.3 emits in the chunksUntil Next.js 16.2 the Turbopack wasm loaders were named
loadWebAssemblyand
loadWebAssemblyModulefunctions living in[turbopack]_runtime.js, which the adapter rewrote to
resolve the chunk through a staticimport(). Next.js 16.3 emits them on demand in the chunks
instead ([turbopack-wasm]/node/loadWasm.ts), so the existing patch silently stopped matching and
WebAssembly.compileStreaming- which workerd does not implement - survived into the Worker.Every wasm backed import then threw
TypeError: WebAssembly.compileStreaming is not a functionat
runtime, most visibly breaking Prisma with theworkerdclient runtime.The chunks emitted by Turbopack are now patched as well, for both the server and the Node.js
middleware bundles. -
#1309
56dfaccThanks @ScienHAC! - feature: support Node.js middleware (proxy.ts)Next.js 16 replaces
middleware.tswithproxy.tswhich always runs on the Node.js runtime.The Node.js middleware is now bundled into a Workers compatible
middleware/handler.mjs:
the OpenNext config manifests are inlined at build time (as for the edge middleware) and the
middleware compiled by Next.js is statically bundled instead of being loaded from the
filesystem at runtime (workerd can not access the filesystem nor load modules at runtime).The support is experimental and requires the
nodejs_compatcompatibility flag. -
#1359
65e4487Thanks @vicb! - fix: do not load the instrumentation hook from the Node.js middleware bundleNext.js 16.3 registers the instrumentation hook from the middleware itself when the middleware
does not run on the edge runtime, by dynamically requiring.next/server/instrumentation.js.
workerd does not support dynamic requires so every request handled by the Node.js middleware
(proxy.ts) failed withDynamic require of ".next/server/instrumentation.js" is not supported.The guard Next.js uses (
process.env.NEXT_RUNTIME !== "edge") is inlined by Next.js when it
compiles the middleware, so it can not be eliminated when the middleware is re-bundled. The loader
is stubbed out instead, which matches the edge runtime behaviour: the server function - which
shares the isolate - keeps registering the hook.