Description
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:
{"errorMessage":"2021-04-03T07:42:16.336Z 3be439c6-d16e-42d2-859f-a66bffe9135e Task timed out after 10.01 seconds"}
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:
context.callbackWaitsForEmptyEventLoop = false;
Look forward to hearing your thoughts! :)