Skip to content

Commit ccc3dc9

Browse files
committed
Update(was): sync with the new handler API
See opennextjs/opennextjs-aws#733
1 parent e3ba077 commit ccc3dc9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pages/aws/config/custom_overrides.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const handler: WrapperHandler =
238238
},
239239
};
240240

241-
const response = await handler(internalEvent, fakeStream);
241+
const response = await handler(internalEvent, { streamCreator: fakeStream });
242242
response.headers["x-wrapper"] = "hi";
243243

244244
return converter.convertTo(response, event);

pages/aws/config/overrides/wrapper.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Couple of things to note :
77
- If you want to use streaming (for the `node` runtime of next), you'll need to create a `StreamCreator` and pass it to the `handler`. You can find some example in the [node](https://github.com/opennextjs/opennextjs-aws/blob/main/packages/open-next/src/overrides/wrappers/node.ts) or [aws-lambda-streaming](https://github.com/opennextjs/opennextjs-aws/blob/main/packages/open-next/src/overrides/wrappers/aws-lambda-streaming.ts) wrapper.
88
- If you don't use streaming (like in the default `aws-lambda` wrapper), you may still need to provide a fake `StreamCreator` to the `handler` to avoid a weird issue with Node itself (see [here](https://github.com/opennextjs/opennextjs-aws/blob/f685ddea8f8a5c82591dc02713aff7138f2d9896/packages/open-next/src/overrides/wrappers/aws-lambda.ts#L49-L65) for an example and a more thorough explanation).
99
- If you use the `edge` runtime of Next (either for the external middleware or for an `edge` route or page), you don't need the `StreamCreator` at all.
10-
- If you are in a serverless environment and it supports `waitUntil`, you should define it here(see [here](https://github.com/opennextjs/opennextjs-aws/blob/b0b1f7776b41612d2638a33e3c9ced8c42afab0a/packages/open-next/src/overrides/wrappers/cloudflare-node.ts#L80). This might not be necessary depending on where you run it (for example the `aws-lambda-streaming` or the `node` wrapper doesn't need it.)
10+
- If you are in a serverless environment and it supports `waitUntil`, you should pass it to the handler as it is done in the [cloudflare-edge wrapper](https://github.com/opennextjs/opennextjs-aws/blob/87b59e59a8a0bf1e83d2d1df9efa0ad3bfc912f5/packages/open-next/src/overrides/wrappers/cloudflare-edge.ts#L65-L67). This might not be necessary depending on where you run it (for example the `aws-lambda-streaming` or the `node` wrapper doesn't need it.)
1111

1212
## Included Wrappers
1313

0 commit comments

Comments
 (0)