next.js
0f6ea101 - [after] fix waitUntil in edge runtime sandbox (pages/api) (#71309)

Commit
1 year ago
[after] fix waitUntil in edge runtime sandbox (pages/api) (#71309) Fixes an issue where using `after` in a `runtime = "edge"` page would throw an error saying that `waitUntil` is missing. This was because we weren't correctly passing `waitUntil` into the edge runtime sandbox. (More precisely, the WebServer we run for those app-page/app-route handlers wasn't receiving `waitUntil` -- middleware goes through a different codepath and thus was fine) This PR (ab)uses the `"@next/request-context"` global ALS (intended for platforms to provide `waitUntil` to Next.js) to fix this -- it works because the wrapped WebServer will read `"@next/request-context"` and thus use the correct `waitUntil`.
Author
Committer
Parents
Loading