## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Jack Howard
@JackHowa
is there a good way of mocking alb? I'm seeing urls that aren't matching what I would expect running serverless-offline?
[offline] Lambda Invocation Routes (for AWS SDK or AWS CLI):
* POST http://localhost:3002/2015-03-31/functions/x-api-sandbox-getBundles/invocations
Jack Howard
@JackHowa
^ this is related to issue dherault/serverless-offline#598 if any one is working on this. I saw someone try to bounty it I think
Jack Howard
@JackHowa
also is there a way to specify a different serverless.yml file to run? I haven't been able to find the equivalent of --config equivalent to serverless. thanks for your help!
looks like it's being tracked here by dherault/serverless-offline#1146
Rafael Franco
@rfoel
How about releasing the support for nodejs14.x?
Zac Tolley
@ztolley
Another Vote here for 14. Is there ANY traction on this?
mikemeerschaert
@mikemeerschaert
Is there a way to just run one function with serverless offline when I have many functions defined in my serverless.yml file?
e.g. given my serverless.yml file looks like this, how do I just run functionB. I tried sls offline --functionB but that builds and starts all the functions, and function A takes a very long time to build. Also, I intend to build many more functions in the future, but I want to be able to run a single functional locally while working on it without having to worry about the rest.
service:
name: backend
plugins:
- serverless-webpack
- serverless-offline
provider:
name: aws
region: us-west-1
runtime: nodejs12.x
functions:
functionA:
handler: handler.functionAHandler
events:
- http:
path: functionA
method: post
- http:
path: functionA
method: get
functionB:
handler: handler.functionBHandler
events:
- http:
path: functionB
method: post
- http:
path: functionB
method: get
Jake Wood
@jakemwood
+1 for Node v14, as well as a +1 for dherault/serverless-offline#1175. I'm happy to help with either of these initiatives.
Zac Tolley
@ztolley
At what point do we have to resort to created an official fork?
selected-pixel-jameson
@selected-pixel-jameson
Does anyone know if this repo is still being supported? It seems as if @dherault has not responded since October. I'm just concerned as this is a pretty big part of a lot of peoples development and the repo now hasn't seen a new release for almost 6 months, was monthly prior to 6.8.0. I've created this question, dherault/serverless-offline#1193, on the github repo. First and foremost I hope that @dherault is ok, but would like to know if the community needs to have a discussion as to where this project is going.
Mirko Buholzer
@buholzer

I have an issue when running serverless-offline with the JWT Authorization function. serverless-offline tries to compare my jwt token with jwtOptions.issuerUrl that points to a cloudformation function.
My jwtOptions from createJWTAuthScheme.js look like this:

{
authorizerName: 'cognitoAuthorizer',
name: 'cognitoAuthorizer',
identitySource: '$request.header.Authorization', issuerUrl: { 'Fn::Join': [ '', [Array] ] }, audience: [ { 'Fn::ImportValue': 'authUserPoolClientId' } ] } Any way I can ignore issuerUrl and audience? Arslan Ali @arslanalidev Hi Guys, I am facing this below error while I am trying to run the serverless offline. Error --------------------------------------------------- Error: Cannot find module 'please-upgrade-node' Require stack: C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless-offline\dist\checkEngine.js C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless-offline\dist\index.js C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless-offline\dist\main.js C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\scripts\serverless.js C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\bin\serverless.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15) at Function.Module._load (internal/modules/cjs/loader.js:687:27) at Module.require (internal/modules/cjs/loader.js:849:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless-offline\dist\checkEngine.js:3:49) at Module._compile (internal/modules/cjs/loader.js:956:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10) at Module.load (internal/modules/cjs/loader.js:812:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Module.require (internal/modules/cjs/loader.js:849:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless-offline\dist\index.js:13:1) at Module._compile (internal/modules/cjs/loader.js:956:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10) at Module.load (internal/modules/cjs/loader.js:812:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Module.require (internal/modules/cjs/loader.js:849:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless-offline\dist\main.js:11:18) at Module._compile (internal/modules/cjs/loader.js:956:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10) at Module.load (internal/modules/cjs/loader.js:812:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Module.require (internal/modules/cjs/loader.js:849:19) at require (internal/modules/cjs/helpers.js:74:18) at requireServicePlugin (C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:28:12) at C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:164:20 at Array.map () at PluginManager.resolveServicePlugins (C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:161:8) at PluginManager.loadAllPlugins (C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:147:10) at Serverless.init (C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:171:30) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async C:\Users\Arslan Titan\AppData\Roaming\npm\node_modules\serverless\scripts\serverless.js:235:7 Tim Stackhouse @tstackhouse How does one run the integration tests properly in order to contribute to the project? I keep getting timeouts because it doesn't look like it's spinning up a local server Dmitry Kireev @AutomationD Something common, prob ably, but Serverless command "offline start" not found. even after installing from "serverless-offline": "github:dherault/serverless-offline#master", 1 reply any word where to look? thanks! Neeraj Mittal @neermitt invoking lambda without event mapping, doesn't seems to work in offline mode jonatan-hello @jonatan-hello Good morning, Layer dont download when adding to provider when i added the layer in the provider section, the layer is not downloaded but if i added it to function, the layer download perfectly ktrancoso @ktrancoso Hello, anyone knows what is the max size a request header can take (i keep having 431 errors :c ) Ahmed Bayoumy @bayoumymac Hey y'all, I was wondering if there was an ongoing work regarding supporting alb events for lambdas, Issue dherault/serverless-offline#598 has been tracking this feature but it went stale. I am happy to pick it up and push it all the way through unless there are reasons not to do so Appreciate y'all Ahmed Bayoumy @bayoumymac Let me know if it changes Alessandro Tagliapietra @alex88 HI everyone, just created an empty aws-nodejs sls project, added serverless offline but I get "Invalid cookie value" trying to make a request why? Oh nvm since I use localhost:3000 I had unrelated cookies in it Brian Edwards @bedwards Hi, is there a plan/timeline for adding Step Function support? (what is the best way to test Serverless-defined Step Function's locally right now) ryanolee @ryanolee @bedwards https://www.npmjs.com/package/serverless-step-functions-offline works fairly well (for python and js runtimes) though it looks to mostly be abandonware at this stage unfortuanteley. :( Brian Edwards @bedwards @ryanolee Thanks for the pointer! Praveen Nambiar @emperorpraveen @sajithneyo were you able to fix the issue with Serverless command "offline" not found. Hi Everyone, I am trying to attach a VS Code debugger with my lambda functions. It works fine when my node_modules is not nested. My launch.json file  "type": "node", "request": "launch", "name": "Launch Serverless Offline", "program": "${workspaceRoot}/nested_folder/node_modules/serverless/bin/serverless",
"args": ["offline", "start", "--httpPort", "4000", "--noTimeout"],
"sourceMaps": true,
"runtimeArgs": ["--lazy"],
"outFiles": ["${workspaceRoot}/.webpack/**/*.js"], "protocol": "inspector", "runtimeExecutable": "node", "resolveSourceMapLocations": [ "${workspaceFolder}/**",
"!**/node_modules/**"
]
}

And my error:

Serverless Error ---------------------------------------Serverless command "offline" not found. Did you mean "config"? Run "serverless help" for a list of all available commands.
brucekaufman
@brucekaufman
Hi, is there a way to run multiple serverless stacks on the same offline server? exploring if it is possible to spin up our whole environment offline rather than just one stack at a time
ryanolee
@ryanolee
Hmm, might be worth having a look into spinning up multiple serverless offline instances using https://www.npmjs.com/package/pm2 @brucekaufman . You can define an ecosystem file that you can use to bootstrap many node processes at once. Used it in the past for a similar application and it worked fairly well.
joeyparis
@joeyparis
Is there a way to get serverless-offline to use jest's mock functions?
Martin Ting
@Martin-Ting
Does any one use serverless-offline-local-authorizers-plugin with a custom authorizer? I'm using the code in the example but I'm seeing that the event I'm passing to the authorizer lambda has random-account-id and random-api-id in the event.
Ihor Khanchuk
@ihanchuk
Hi guys
doe anyone knows how to fix this error Serverless: Offline requires Serverless v1.x.x but found 2.57.0. Exiting.
ryanolee
@ryanolee
Possibly lock your version of the serverless CLI to one @ihanchuk . (Npm install serverless@1) or update the version of serverless offline you are using 🤔
Hi, does Serverless Offline not support Node.JS v14?
ats-org
@ats-org
Hey peep, any one having issues with serverless offline that it just hangs at invoke offline?
ryanolee
@ryanolee
@ats-org Is this with a POST request. Might be down to the version of node you are running as from what I can remember requests hang on v15 / v16 so might be worth downgrading using nvm?
ats-org
@ats-org
@ryanolee im using node12
and it's on the initial start up not actually trying to invoke a function
ats-org
@ats-org
@ryanolee actually figured it out, the port pointing to the dynamodb was incorrect, there should probably be some check and error if it can't be found.
Francesco Belvedere
@belvederef
Hi all, does anybody here use Esbuild? Vscode debugging works fine with Webpack, but not with esbuild. I thought it would be an issue with sourcemaps, so I enabled them in the esbuild config, and can see they are correctly generated, however, this does not solve it. Any clue?