dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda 🎉
Other
1.72k stars 165 forks source link

Error: Unsupported framework + express #164

Closed mogaal closed 4 years ago

mogaal commented 4 years ago

Hello, I've been trying to implement a simple hello world with express, serverless-offline and serverless-http but I am just giving up :-(. Basically I'm always getting Error: Unsupported framework:

$ serverless offline start

  Error --------------------------------------------------

  Error: Unsupported framework
      at getFramework (/Users/mogaal/workspace/github/mogaal/learning-serverless/node_modules/serverless-http/lib/framework/get-framework.js:69:9)
      at new module.exports (/Users/mogaal/workspace/github/mogaal/learning-serverless/node_modules/serverless-http/serverless-http.js:14:21)
      at PluginManager.addPlugin (/snapshot/serverless/lib/classes/PluginManager.js:78:28)
      at /snapshot/serverless/lib/classes/PluginManager.js:115:31

All the source code is public here (my learning repo). Mostly I have been following this guide

I've tried with Koa, downgrading express, downgrading serverless-http to v2.1.0but not luck. After posting this I am gonna try downgrading node but... ¯_(ツ)_/¯

Thanks in advance.

PD: I'm not JS expert so apologies if it is something very obvious. I also realised something else is on the same page

My environment

+ express@4.17.1
+ serverless-http@2.5.0
+ serverless-offline@6.3.0
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.16.1
     Framework Version:         1.71.3 (standalone)
     Plugin Version:            3.6.12
     SDK Version:               2.3.0
     Components Version:        2.30.11
mogaal commented 4 years ago

Fixed, everything was because I had serverless-http line in plugins (under serverless.yaml who knows why ¯_(ツ)_/¯

plugins:
  - serverless-http
  - serverless-offline

Just removing it fixed everything. Thanks a lot anyway

dougmoscrop commented 4 years ago

oh wow, haha I took a peek at your code but I did not see that. interesting bug! glad you got it sorted

YakirSolomon commented 4 years ago

Shouldn't you had to have this line in the plugins section of the serverless.yml in order to have it work on AWS?

dougmoscrop commented 4 years ago

No, it's not a plugin, it's a library. It doesn't even require that you use the Serverless framework. You could use terraform or SAM

afern247 commented 3 years ago

Fixed, everything was because I had serverless-http line in plugins (under serverless.yaml who knows why ¯(ツ)

plugins:
  - serverless-http
  - serverless-offline

Just removing it fixed everything. Thanks a lot anyway

That's because when you do serverless plugin install --name serverless-http the serverless framework puts that line in the .yml file for you, I wonder about this...