medikoo / serverless-plugin-reducer

Serverless plugin: Reduce Node.js lambda package so it contains only lambda dependencies
ISC License
14 stars 5 forks source link

Issue working with serverless-newrelic-lambda-layers #10

Open rbpimenta opened 3 months ago

rbpimenta commented 3 months ago

So, I believe this plugin have an issue working along with serverless-newrelic-lambda-layers.

I have the following plugins on my project

plugins:
  - serverless-domain-manager
  - serverless-dynamodb
  - serverless-associate-waf
  - serverless-prune-plugin
  - serverless-plugin-conditional-functions
  - serverless-middleware
  - serverless-plugin-typescript
  - serverless-newrelic-lambda-layers # should be after serverless-plugin-typescript
  - serverless-offline-sns
  - serverless-offline # needs to be last in the list

And when I added the plugin serverless-plugin-reducer it started failing with the following error:

  Error:
  "newrelic-lambda-wrapper.handler" doesn't reference a valid Node.js module

Does anyone know how to fix that?

medikoo commented 3 months ago

@rbpimenta I've created a minimal test case that involves serverless-newrelic-lambda-layers and it packages without the issues -> https://github.com/medikoo/test-serverless/tree/issue-reducer-10

I suspect problem on your side might be caused by transpilation. Also this plugin may not work with ESM modules (it was created before they were natively supported in Node.js)