-
Notifications
You must be signed in to change notification settings - Fork 86
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
Default callbackWaitsForEmptyEventLoop to false? #190
Comments
@FinnWoelm oh hey finn |
after some internal discussion, seems like we may add an option to turn |
Ok, that's a pretty good solution. I'm still trying to better understand what this thing actually means... I just saw that there's an async version of the function handler, that doesn't use callback at all: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html#nodejs-prog-model-handler-callback (see Async handlers). I wonder if this whole question would be solved by just switching to async handler. AWS docs say this:
(source: same link as above) If I get a chance, I'll do some experimentation... |
Netlify also advertises the non-callback async handler: |
What's a relatively easy way to test this before it gets implemented? This is a pretty huge blocker for us at the moment. |
@speakk whoa! wild to see you comment this because it's next up on my to-do list. i will get to it this week, but for now, you could use patch-package like described in this comment: #191 (comment) hang tight! |
Awesome, thank you muchly! :) |
@speakk do you have a repo to test a fix/branch against? |
* fix: support wasm chunks * Import from vendor
Hi y'all! Amazing plugin. Love how it now works completely out of the box with zero setup 🤩 ❤️
I just ran into the
Task timed out after 10.01 seconds
issue:I know this is caused because, by default, AWS lambda waits for empty event loop. And this needs to be explicitly turned off for some libraries (firebase, faunadb). See: netlify/next-on-netlify#66 (comment)
Is there any harm in turning off this waiting-for-empty-event-loop-behavior by default for the Netlify Functions created by this plugin?
It would solve issues like this: https://stackoverflow.com/questions/65243013/next-on-netlify-function-times-out-10s-when-deployed-renders-in-0-3s-locally
The fact that it works out of the box with Vercel makes me think that there might be no harm in turning this off as the default. Perhaps one of you actually knows what the implications would be?
The implementation would be a very simple one-liner in https://github.com/netlify/netlify-plugin-nextjs/blob/main/src/lib/templates/netlifyFunction.js:
Look forward to hearing your thoughts! :)
The text was updated successfully, but these errors were encountered: