Enigmatic-Smile / serverless-plugin-optimize

⛔️ DEPRECATED ⛔️ Bundle with Browserify, transpile and minify with Babel automatically to your NodeJS runtime compatible JavaScript
https://www.npmjs.com/package/serverless-plugin-optimize
MIT License
130 stars 53 forks source link

Optimize plugin breaks "Fastify" #86

Open hakimio opened 5 years ago

hakimio commented 5 years ago

Steps to reproduce

  1. Checkout fastify branch from hakimio/nest-serverless github repository
  2. Install dependencies: yarn install
  3. Try to run lambda function locally: yarn run test:sls

Results You Received:

sls invoke local fails with "Cannot convert undefined or null to object" error coming from fastify.

Results You Expected:

If you disable optimize plugin, the test succeeds with 200 response:

{
    "statusCode": 200,
    "body": "Hello World!",
    "headers": {
        "content-type": "text/plain; charset=utf-8",
        "content-length": "12",
        "date": "Mon, 09 Sep 2019 08:46:52 GMT",
        "connection": "keep-alive"
    },
    "isBase64Encoded": false
}

Environment Details:

Serverless: 1.51.0 serverless-plugin-optimize: 4.1.0-rc.1

nabsofken commented 3 years ago

@hakimio I am getting the same error. Did you manage to get it resolved?

hakimio commented 3 years ago

This issue is pretty old, but, as far as I can remember, I just stopped using this plugin. I don't think I ever found any solution.

hakimio commented 3 years ago

Just checked my git log: I just replaced this plugin with serverless-layers.