Serverless-offline: Why serverless offline says found unsupported runtime nodejs8.10?

Created on 3 Apr 2018  ยท  9Comments  ยท  Source: dherault/serverless-offline

Most helpful comment

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)

All 9 comments

It needs an update:

https://github.com/dherault/serverless-offline/blob/4162446f8b8626c40b6bb3dc915a3a0908dbc9ca/src/index.js#L318

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

Thanks @cmendes0101 :D

I've made a PR
https://github.com/dherault/serverless-offline/pull/382

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.

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.

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

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!

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)

Hi @JimLynchCodes,

do you able to solve the problem given above?

Hi @JimLynchCodes

Did you found any solution for the above one?

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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

MEGApixel23 picture MEGApixel23  ยท  4Comments

dnalborczyk picture dnalborczyk  ยท  3Comments

jormaechea picture jormaechea  ยท  4Comments

conradoramalho picture conradoramalho  ยท  3Comments

davidroman0O picture davidroman0O  ยท  4Comments