-
-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API routes return CloudFront 503 on next
12.0.9
#2327
Comments
We are having same issue just with different error code. the error as we see it in cloudwatch
|
Same for us. It breaks from |
next
> 12.0.1
next
12.0.9
@jakubriedl @Purii I just confirmed |
I can also confirm working with version |
Confirmed 12.0.8 works fine, and 12.0.9 does not work. |
I had the same issue but with |
Got the same Issue and I switched to 12.0.8. Is there other suggestions to resolving the apiResolver? Same error referenced above:
|
I also have the same error. Any news? Nextjs 12.0.10 |
I still encounter the error in 12.1.0 as well. |
@dphang is there something how we can help with fixing this one? Is the PR raised by @KensukeTakahara good or does it need some improvements? |
@jakubriedl thanks, I had gotten busy and had less time the past weeks so have just merged these changes. Will publish a new version soon. |
Thanks for useful information. I've looked around this for a couple of weeks. |
This issue has been resolved in v3.7.0-alpha.9. |
I can confirm that https://github.com/serverless-nextjs/serverless-next.js/releases/tag/v3.7.0-alpha.9 works with Next.js However, if you have
I tried to find if there would be an easy fix to support this also in v2 handler, but couldn't find correct place to do copypasta. |
I apologize if this is not the right place to ask this question, but do you happen to know if AWS Amplify uses serverless-nextjs for deploying Next.js apps? When using Amplify to deploy our app I encounter the same issue (unless I switch to Next 12.0.8) |
@traianturcu I'm not sure, but not necessary. If I understood correctly, next.js just broke one internal API without any notice. I guess they don't care that much about the 3rd party deployments so they can do these kind of changes silently and keep Vercel updated. |
Unfortunately we're still seeing the same behaviour with In our stack we do our own provisioning using CDK and use this library only to build the js files that are pushed to lambda. The code to build it follows import { CoreBuildOptions } from "@sls-next/core"
import { LambdaBuilder } from "@sls-next/lambda"
const cmd = join(require.resolve("next"), "../../bin/next")
const outputDir = ".lambda"
const options: CoreBuildOptions = {
cmd,
outputDir,
}
const builder = new LambdaBuilder({}, options)
builder.build(true).then(() => {
// some of our custom stuff
}) |
I'm also getting this issue with [email protected] and |
The problem with |
It works now for us as well, thanks a lot everyone |
I can confirm that it works with next.js 12.1.0. Unfortunately rewrites to api routes doesn't work with this. I'm not sure if it is related to changes made in this MR. But e.g.
gives 404 if you try to access /sitemap.xml. But /api/sitemap URL works fine. |
@jokinol |
@KensukeTakahara Probably not, but I can confirm that API rewrites works with So either this or something that was merged before broke this functionality. |
@jokinol |
Ok, so i tested this and looks like rewrites are broken also in |
Sorry about confusion, but seems that it also works with |
Hi everybody, I was having the 503 error today after setting up a pretty standard nextjs project using serverless-next.js 3.6.0, I thought it was a Lambda permission issue so I created a new role/policy but the error persisted, I'm using next 12.1.0 btw. Reading through the comments I saw some people mention the alpha pre-release so I tested 3.7.0-alpha.10 and boom, the default api that comes in the example project (api/hello) started working! I even removed the policy/role that I created and everything is still working just fine, I hope this helps someone too. |
Yup, I also had this issue. Upgrading to |
I also have this problem. |
Does |
I just upgraded to the following, and confirmed that API routes are working fine 🚀 "next": "12.1.6",
"@sls-next/cdk-construct": "3.7.0",
"@sls-next/lambda-at-edge": "3.7.0", Thanks a ton @KensukeTakahara & @dphang ❤️. Resolved by #2344 |
(I think this is a feature request, more than a bug 🤔)
Is your feature request related to a problem? Please describe.
When upgrading
next
from12.0.8
to12.0.9
, API routes started to return a generic 503 from CloudFront.A barebones API route (
/api/health.ts
) would return a generic 503 CloudFront errorDescribe the solution you'd like
For these to just work with
next
>=12.0.9
🙏Describe alternatives you've considered
Pin
next
to12.0.8
Additional context
vercel/next.js@v12.0.8...v12.0.9
Footnotes
https://github.com/serverless-nextjs/serverless-next.js/issues/2327#issuecomment-1026500341 ↩
The text was updated successfully, but these errors were encountered: