27fe5c8c28
The behaviour of edge-function-runtime in the case of an error was not identical to the edge-runtime. If a type other than "Uint8Array" is written to the Response stream a unhandledreject is raised and logged. The current implementations(nodejs) accepts also Buffers and Strings which causes that a Application Developer things our stream implementation is broken if it is executed as worker. We introduced a helper function to consume the response stream and write the "Uint8Array" stream chunks to the server implementation. Due to the complication that the error side effect is emitted via the unhandledrejection handler it is almost impossible to test --- jest does not allow testing of the unhandlerejections. We tested extendsiveliy the helper in the edge-runtime so that this PR integrates just the consuming function. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by: JJ Kasper <jj@jjsweb.site> |
||
---|---|---|
.. | ||
api-utils | ||
base-http | ||
dev | ||
lib | ||
response-cache | ||
send-payload | ||
web | ||
accept-header.ts | ||
app-render.tsx | ||
base-server.ts | ||
body-streams.ts | ||
config-schema.ts | ||
config-shared.ts | ||
config-utils.ts | ||
config.ts | ||
crypto-utils.ts | ||
font-utils.ts | ||
get-app-route-from-entrypoint.ts | ||
get-page-files.ts | ||
get-route-from-entrypoint.ts | ||
google-font-metrics.json | ||
htmlescape.ts | ||
image-optimizer.ts | ||
internal-utils.ts | ||
load-components.ts | ||
match-bundle.ts | ||
next-server.ts | ||
next.ts | ||
node-polyfill-fetch.js | ||
node-polyfill-web-streams.js | ||
node-web-streams-helper.ts | ||
optimize-amp.ts | ||
post-process.ts | ||
render-result.ts | ||
render.tsx | ||
request-meta.ts | ||
require.ts | ||
router.ts | ||
serve-static.ts | ||
server-route-utils.ts | ||
utils.ts | ||
web-server.ts |