Open zoellner opened 4 years ago
Might want to check https://github.com/dherault/serverless-offline/issues/1075 to see if that is the issue you're having.
Yes, I think it comes down to the same underlying change in serverless-offline (was a bit too far into the weeds to realize when I opened this ticket and forgot to link it)
But the proposed workarounds for serverless-offline api endpoints (useChildProcesses
and allowCache
) don't work in the combination with serverless-offline-sqs. I'm assuming that there's something in the way the plugin calls the lambdas that ignores some of these settings.
for a quick fix, this combination worked for me: "serverless-offline": "5.12.1", "serverless-offline-sqs": "3.1.3",
I'm running into issues using the latest versions of serverless-offline and serverless-offline-sqs
This might be related to the general discussion in https://github.com/CoorpAcademy/serverless-plugins/issues/102
I created a very minimal demo here: https://github.com/zoellner/offline-sqs-bug
The issue comes down to a very simple piece of code:
Triggering two messages to this code will throw an error (the first one runs fine). The problem is in the variable require that's outside the event handler. The demo with the aws-sdk is just an example since that's a very common dependency. I've seen a similar issue using pino logger and others.