Closed rubenkaiser closed 2 years ago
@godu would you please take a look? i dont really want to keep local plugin copy in our repo - so if you could review/approve/release - would be great ;)
Is this going to be merged in? It'd also keep us from maintaining it locally.
A new PR is present at https://github.com/dherault/serverless-offline/pull/1552 that will add named exports for the lambda code we need in this plugin. This will also affect this PR so when the mentioned PR has gone through I will update this one as well. This will only affect the async import in the _createLambda changing it to:
const { Lambda } = await import('serverless-offline');
Been trying to fix the builds, but the node12 build will remain a problem since dynamic import (which is used for the new sls offline lambda import) is supported from 13.2. I'll leave the decision to upgrade this to the repo owners.
As a user of the plugin, since node.js 12 is very soon about to be deprecated as a lambda runtime it feels it would be much more valuable to have a version which can work with more recent serverless-offline even if it means dropping the support for node12.
Afaik right now there is no way to run Node 16 lambdas with serverless offline & offline sqs since the node16 is not supported by serverless offline versions which are still compatible with the latest version of the plugin.
@godu Please take a look of this PR, we do really need it
@godu Most people using this are blocked on moving to serverless-offline 10 still because of these changes. It'd be really useful to get this change merged and the dependencies moved to Node13.2/Node14+ on a new release across serverless-plugins.
still someone trying to defend the late node 12? 🥹
@rubenkaiser i pulled it directly from your PR and it looks like the error really stopped, but the serverless offline hangs on this line:
Starting Offline SQS: devel/us-east-1.
@luisdemarchi can you give some more details. I didn't really change the workings, just the way the lambda's are handled. Are the credentials for the queue correct? Or do you emulate the queue with elasticMQ locally?
@rubenkaiser I already found the error. It was just a setting that I accidentally modified
Taking quite some time so I decided to quickly (read: without testing) publish a version of the update to use for the time being:
This isn't going to happen. The last time this repo was updated was a year ago. I suggest looking in to LocalStack instead or @rubenkaiser alternative repo
But if they do not update the serverless-offline package, wouldn't this mean, that the whole serverless.js ecosystem is not useable anymore?
But if they do not update the serverless-offline package, wouldn't this mean, that the whole serverless.js ecosystem is not useable anymore?
No, it will mean that the plugins in this repo will not be usable anymore. But for now you can try my published package for sqs
@rubenkaiser Thank you for your work. I applied the same logic to the others packages. https://github.com/CoorpAcademy/serverless-plugins/pull/228 It is already available in the latest publish 🚀
SLS offline was converted to a pure esm module in version 9 and since then the import of modules throws an error. Therefore I added a dynamic import for the lambda code keeping the rest of the plugin pretty much the same.
After this update you still need to remove the single "exports" line from node_modules/serverless-offline/package.json by hand to be able to import the required lambda files. In the serverless-offline-eventBridge plugin I automated this but it is not a nice solution.