You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've just tried moving from Serverless Components to SST for the deployment of our disposable branch environments and we're trying to replace that with SST before we think about moving the main site over.
We've had a lot of luck getting our site working on SST, but there's one thing that is behaving a bit weird that we just can't figure out. Not sure if this is a bug or just a documentation/concept error or whatever. So I'll just ask our question here as I haven't been able to find any information on it at all.
We have a NextJS 12.x site which we deploy via serverless components. That deploy uses Cloudfront and has an s3 bucket with default and API lambdas attached to it.
We've tried redeploying the same thing with SST and it's worked, mostly. We can see the site, some content even loads. We're nearly there. But, for reasons we don't understand, the `/api' routes are not returning data. We can see the routes being called in logs, we can see the current status being returned (e.g. one of our routes returns 500 due to a misconfiguration we haven't fixed, and that's correct, others return correct 200s). But no JSON. No data is being returned.
When trying to understand it a bit better, we notice that there is no longer an API lambda in the deployment, but that everything goes through the default lambda and we think that's normal based on the diagram of the system architecture.
Any advice on what we're doing wrong? And if so, any documentation that could be written to help others (assuming we're not being idiots)?
Also, we're noticing there aren't any edge functions that we can obviously tell in Cloudfront, and don't know if we have some issues with that as well.
One of the responders there mentioned it could be an issue with us using Next 12 and suggested we ask here. Any ideas, and does it seem most likely (as they suggest) that our issue is due to using Next 12 with the latest version of OpenNext?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi @khuezy, we have now upgraded the application over to Next.js 14.
The /api/* routes are now returning 304 Not Modified responses. Looking at the Default lambda logs, we cannot see any logs from these routes.
We then tried to call one /api endpoint with postman. This managed to reach the Default lambda, as we can see some logs but the response body is still empty.
Over on SST Ion we posted this issue:
sst/sst#4282
One of the responders there mentioned it could be an issue with us using Next 12 and suggested we ask here. Any ideas, and does it seem most likely (as they suggest) that our issue is due to using Next 12 with the latest version of OpenNext?
Thanks!
The text was updated successfully, but these errors were encountered: