-
-
Notifications
You must be signed in to change notification settings - Fork 458
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
503 error on invoking an API endpoint #1776
Comments
Hm, I think it's Next.js inlining not preventing assignment properly (usually inlining process.env etc.). This component doesn't touch the chunks generated by Next.js, can you try to build locally and see if there is the same issue in your Next.js chunks as well? If so, you'll have to check |
Seems to be related to packaged up NextJS code, the following code: is being packaged into this inside the chunk:
and then the |
Hm, I think it's a problem in webpack when next.js is built for serverless target, unfortunately. Maybe you might try something like here to redefine the DefinePlugin config: debug-js/debug#467 (comment) |
Will give it a go and report back. In the meantime I've also opened a bug in NextJS: vercel/next.js#29582 |
i had similar, and it had to do with version conflict between next, webpack and typescript. what version of typescript and webpack are being used? |
@moimikey these are the versions i am using:
|
@dphang Vercel maintainer suggests it is how serverless-next is handling the next-server bundling:
Is this the case? |
No, we are not bundling anything with webpack, only with Rollup.js but that's only this component's code (and it's pre-bundled). Basically all the page JS and chunks JS is just copied along with the pre-bundled handler code (which will dynamically require the Next.js page JS). So I think it should still be an issue in Next.js. Maybe just confirm the issue happens with just |
Issue does not happen with |
Ok, can you please share a minimal repro repository, I wasn't able to see any issue in |
@dphang after a tortuous path I finally found the culprit. We use Sentry and deep in their docs it says that the webpack configuration is not compatible with serverless environments: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/. Closing this issue. |
Issue Summary
Getting a 503 error when invoking API endpoint
Actual behavior
503 error returned
Expected behavior
200 OK returned
Steps to reproduce
Created the simplest API to test:
also simplest serverless.yml:
Screenshots/Code/Configuration/Logs
Curl response:
Lambda error log:
Versions
@sls-next/[email protected]
Next.js 11.1.2
Additional context
N/A
Checklist
latest
oralpha
@sls-next/serverless-component
release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.The text was updated successfully, but these errors were encountered: