Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why serverless offline says found unsupported runtime nodejs8.10? #381

Closed
chanlito opened this issue Apr 3, 2018 · 9 comments
Closed

Why serverless offline says found unsupported runtime nodejs8.10? #381

chanlito opened this issue Apr 3, 2018 · 9 comments

Comments

@chanlito
Copy link

chanlito commented Apr 3, 2018

screen shot 2018-04-03 at 9 25 00 am

@gcphost
Copy link
Contributor

gcphost commented Apr 3, 2018

It needs an update:

if (['nodejs', 'nodejs4.3', 'nodejs6.10', 'babel'].indexOf(serviceRuntime) === -1) {

13 PRS and repos owners profile says hes on vacation till 2018.

Thanks @cmendes0101 :D

I've made a PR
#382

@clschnei
Copy link
Contributor

I know this issue is closed, but if it does a runtime check and and fails to actually serve up the routes, should it throw an error instead of declaring a warning? I just ran into this same issue, and it wasn't obvious what the problem was since it was just a Warning and my understanding was that the plugin uses my local runtime regardless.

@gcphost
Copy link
Contributor

gcphost commented May 16, 2018

I would agree that it should throw an Error instead of Warning. I've made this mistake too because we work on so many projects and are always switchining node versions.

@necevil
Copy link

necevil commented Dec 1, 2018

I am running into this right now — as @clschnei mentioned I am node 8.10 locally (via nvm use 8.10) but I am getting the following error: Serverless: Warning: found unsupported runtime 'nodejs8.10'

Have upgraded Serverless and Serverless-Offline.
Will post back if I figure out whats going on but it would be great to know that it ISN'T a runtime issue to be able to put that portion of it to bed.

For what it's worth my serverless.yml runtime is set to:

provider:
  name: aws
  runtime: nodejs8.10

@necevil
Copy link

necevil commented Dec 1, 2018

OK so I copied my node_modules directory over from a pre-existing project on the same stack and now it works. My guess it is some combination of the serverless version, serverless offline version and potentially serverless offline sqs versions.

Since I am on a paid client gig I can't go further into it than that — but obviously this was not a Runtime issue in my case as well, and the Warning text cost me time when trouble shooting.
Thanks guys!

@JimLynchCodes
Copy link

Sorry to hijack this thread, but I'm getting a similar error in a go lang project, scaffolded with:

serverless create --template aws-go-dep

I'm running this command:

serverless offline

and getting this output:

offline: Starting Offline: dev/us-east-1.
offline: Offline [http for lambda] listening on http://localhost:3002
offline: [GET] http://localhost:3000/hello
offline: [GET] http://localhost:3000/world
offline: 
offline: [HTTP] server ready: http://localhost:3000 🚀
offline: 
offline: OpenAPI/Swagger documentation:
offline: [GET] http://localhost:3000/documentation
offline: 
offline: Enter "rp" to replay the last request
offline: 

I get this fine output when the lambda function loads up:

offline: Starting Offline: dev/us-east-1.
offline: Offline [http for lambda] listening on http://localhost:3002
offline: [GET] http://localhost:3000/hello
offline: [GET] http://localhost:3000/world
offline: 
offline: [HTTP] server ready: http://localhost:3000 🚀
offline: 
offline: OpenAPI/Swagger documentation:
offline: [GET] http://localhost:3000/documentation
offline: 
offline: Enter "rp" to replay the last request
offline:

But then when I try to hit the endpoint it crashes with this error:

offline: GET /hello (λ: hello)

offline: Warning: found unsupported runtime 'go1.x' for function 'hello'
offline: Failure: Unsupported runtime
Error: Unsupported runtime
    at HandlerRunner._loadRunner (/Users/jim/node_modules/serverless-offline/src/lambda/handler-runner/HandlerRunner.ts:76:11)
    at HandlerRunner.run (/Users/jim/node_modules/serverless-offline/src/lambda/handler-runner/HandlerRunner.ts:109:33)
    at LambdaFunction.runHandler (/Users/jim/node_modules/serverless-offline/src/lambda/LambdaFunction.ts:210:46)
    at hapiHandler (/Users/jim/node_modules/serverless-offline/src/events/http/HttpServer.ts:813:45)
    at module.exports.internals.Manager.execute (/Users/jim/node_modules/@hapi/hapi/lib/toolkit.js:41:33)
    at Object.internals.handler (/Users/jim/node_modules/@hapi/hapi/lib/handler.js:46:48)
    at exports.execute (/Users/jim/node_modules/@hapi/hapi/lib/handler.js:31:36)
    at Request._lifecycle (/Users/jim/node_modules/@hapi/hapi/lib/request.js:312:68)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)

@dushaprasanna
Copy link

Hi @JimLynchCodes,

do you able to solve the problem given above?

@Chandangbox
Copy link

Hi @JimLynchCodes

Did you found any solution for the above one?

@mrtrom
Copy link

mrtrom commented Sep 22, 2020

This might be an old thread but I ended up here after getting the error described by @JimLynchCodes.

For future references, Go runtime is supported only via docker-runner which is toggled with --useDocker flag like:

❯ sls offline --useDocker
Serverless: Stage is set to "dev"
Serverless: Region is set to "us-east-1"
offline: Starting Offline: dev/us-east-1.
offline: Offline [http for lambda] listening on http://localhost:3002

   ┌─────────────────────────────────────────────────────────────────────────┐
   │                                                                         │
   │   GET | http://localhost:3000/dev/hello                                 │
   │   POST | http://localhost:3000/2015-03-31/functions/hello/invocations   │
   │                                                                         │
   └─────────────────────────────────────────────────────────────────────────┘

offline: [HTTP] server ready: http://localhost:3000 🚀
offline: 
offline: Enter "rp" to replay the last request

offline: GET /dev/hello (λ: hello)
Lambda API listening on port 9001...

START RequestId: 74e251a2-974d-1c84-51bf-664e6f72a147 Version: $LATEST

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants