jetbridge / cdk-nextjs

Deploy a NextJS application using AWS CDK
https://constructs.dev/packages/cdk-nextjs-standalone
Apache License 2.0
279 stars 47 forks source link

result.toUnchunkedString is not a function #235

Open AlexTech314 opened 2 hours ago

AlexTech314 commented 2 hours ago

I am using nextjs as part of a NestedStack. Please see my exact usage here: https://github.com/AlexTech314/ProjectBase

Upon completing deployment, the NextjsServer Lambda is throwing the following error in Cloudwatch logs:

2024-11-16T02:36:08.461Z 300f0821-105f-4b1d-a88f-62ba3cac482a ERROR ⨯ TypeError: result.toUnchunkedString is not a function at sendRenderResult (/var/task/node_modules/next/dist/server/send-payload.js:66:54) at NextNodeServer.sendRenderResult (/var/task/node_modules/next/dist/server/next-server.js:581:50) at NextNodeServer.pipeImpl (/var/task/node_modules/next/dist/server/base-server.js:975:24) at async NextNodeServer.handleCatchallRenderRequest (/var/task/node_modules/next/dist/server/next-server.js:281:17) at async NextNodeServer.runImpl (/var/task/node_modules/next/dist/server/base-server.js:945:9) at async NextNodeServer.handleRequestImpl (/var/task/node_modules/next/dist/server/base-server.js:879:20) at async fVe (index.mjs:66:10292) at async Runtime.F7 [as handler] (index.mjs:66:10147)

I've found a recently opened and resolved issue in opennext-aws pertaining to a similar problem. https://github.com/opennextjs/opennextjs-aws/issues/507

I attempted to follow the app-router example laid out to no avail.

Is this a know issue?

AlexTech314 commented 2 hours ago

It seems that an upgrade to open-next 3.1.3 would solve the issue, but I am not totally sure.