Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Quenby Mitchell
    @qswinson
    Greetings! Are there any instructions on how to add a test suite to the serverless-offline project? I want to develop a JWT authorizer for HttpApi events, but am having difficulty getting my new test fixture to run with the babel-fied code
    1 reply
    Richard Tan
    @chardos
    @Stegosource_twitter I've replied to your issue on github, but you should be able to just remove the cors option from your endpoints
    Xitij Ritesh Patel
    @HorizonXP
    Hi, I'm attempting to use Serverless-offline to mock an httpApi event, but it's not picking up the routes (says none), so I keep getting 404s. If I switch to normal http events, it works fine. Anything I should attempt to do to debug?
    David Hérault
    @dherault
    Mmm, I'm not sure httpApi events are supported, @chardos did you see that in the code?
    I'm checking it out right now
    There is support for httpApi, weird its not working
    Can you present a minimal repo in an issue @HorizonXP ?
    Xitij Ritesh Patel
    @HorizonXP
    Yes, let me attempt to put that together
    David Hérault
    @dherault
    Great!
    @dherault let me know if you have trouble accessing or running it
    Quenby Mitchell
    @qswinson
    @HorizonXP you need to modify your httpApi event definitions to use properties not a string:
          - httpApi:
              method: 'POST'
              path: /data
          - httpApi:
              method: 'GET'
              path: /data
    Xitij Ritesh Patel
    @HorizonXP
    @qswinson unfortunately, I did try that beforehand, and it yielded the same results. I'll push a commit now thouhg.
    Payam Mousavi
    @pamit
    Hi. Can someone please help me with dherault/serverless-offline#1031 Thanks!
    It's an issue with using Ruby module/class to define an endpoint (function).
    Theo
    @shierro
    Hi! anyone have successfully used the latest plugin to run typescript apps?
    Theo
    @shierro

    I was able to get something to work using the library(at least for HTTP event)
    https://gist.github.com/shierro/e5136e34ae8ac12f7e3e94c7c6b7b555

    But I am facing some issue w/ testing using the "http lambda" endpoint
    https://github.com/dherault/serverless-offline/issues/969#issuecomment-649456816

    Richard Tan
    @richardtapendium
    @HorizonXP You're using version 3.8.3. Could you please update to v6?
    If it's still not working, we can investigate further
    Adam Hynes
    @giveadamakick

    Hi! My serverless app does some request template mapping to get the raw body received from a Stripe webhook (it needs the raw body for verification by signing). The request template mapping works in "real" API gateway in my dev environment. When running locally with serverless-offline, I'm getting an undefined event being passed to my lambda function. Here's how my config looks:

      sessionCompletedStripeWebhook:
        handler: src/session-completed-stripe-webhook/handler.sessionCompletedStripeWebhook
        events:
          - http: 
              path: /stripe/session-completed
              method: post
              cors: true
              integration: lambda
              request:
                template:
                  application/json: '{ "rawStripeEvent" : "$util.escapeJavaScript($input.body).replaceAll("\\''", "''")", "stripeSignature" : "$input.params(''Stripe-Signature'')" }'

    Does anyone know if serverless offline supports inline request template mapping config like this? In the README, there's a section on using velocity templates. I gave that a shot but it also didn't work, but without a good example I wasn't sure if I was doing it right.

    Adam Hynes
    @giveadamakick
    I managed to get it working with a separate velocity template as described in that page. It seems however that it's not possible to get the raw body untouched in a way that satisfies Stripe's verification when running with serverless-offline. The same problem has been encountered by others: dherault/serverless-offline#522.
    Xitij Ritesh Patel
    @HorizonXP
    @richardtapendium Thanks, I don't know how I missed the package.json version before, but that resolved it!
    David Hérault
    @dherault
    I'm back
    :)
    mamhaidly
    @mamhaidly
    hi is it possible to run the sls offline start command on a file named other than serverless.yml ?
    David Hérault
    @dherault
    @mamhaidly This is not an issue with serverless offline but with the serverless frameworks. I do not think so
    dl748
    @dl748
    I currently use serverless.json files instead of the yml files
    Sajith Neyomal
    @sajithneyo

    Guys how to use vscode-debugger with serverless-offline? My current configurations(launch.json) is bellow,

    {
        "version": "0.2.0",
        "configurations": [
            {
                "type": "node",
                "request": "launch",
                "name": "Launch Serverless Offline",
                "program": "${workspaceRoot}/node_modules/serverless/bin/serverless.js",
                "args": [
                    "offline",
                    "--noTimeout",
                    "--dontPrintOutput",
                    "--stage=local",
                    "-P",
                    "4000",
                    "--aws-profile=#PROFILENAME#"
                ],
                "sourceMaps": true,
                "runtimeArgs": ["--lazy"],
                "outFiles": ["${workspaceFolder}/**/services/user/build/**/*.js"],
                "protocol": "inspector",
                "runtimeExecutable": "node",
                "env": {
                    "SLS_DEBUG": "*"
                },
                "windows": {
                    "program": "${workspaceRoot}\\node_modules\\serverless\\bin\\serverless.js"
                }
            }
        ]
    }

    it throws following error.

    Serverless Error ---------------------------------------
    node_modules/serverless/lib/classes/Error.js:12
    
    node_modules/serverless/lib/classes/Error.js:12
      ServerlessError: Serverless command "offline" not found. Did you mean "config"? Run "serverless help" for a list of all available commands.
    Helmut Kian Rohrbacher
    @helmutkian
    Hi all, I'm getting a MODULE_NOT_FOUND error from InProcessRunner.js when trying to use Lambda#invoke on another function running in my serverless offline environment. It seems instead of using HTTP, it's trying to load the module from src/
    I am using Typescript and Webpack
    Helmut Kian Rohrbacher
    @helmutkian
    Ah adding serverless-plugin-typescript to my plugins resolved the issue
    dl748
    @dl748
    if you use serverless-plugin-typescript then webpack isn't needed
    bregard
    @bregard
      Error --------------------------------------------------
    
      Error: Cannot find module 'serverless-offline/src/functionHelper'
      Require stack:
      - /Users/bregard/cartoon-play-api/source/nodejs/.serverless_plugins/plugin-local-invoke.js
      - /usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/lib/classes/PluginManager.js
      - /usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/lib/Serverless.js
      - /usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/scripts/serverless.js
      - /usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/bin/serverless.js
          at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
          at Function.Module._load (internal/modules/cjs/loader.js:840:27)
          at Module.require (internal/modules/cjs/loader.js:1019:19)
          at require (internal/modules/cjs/helpers.js:77:18)
          at Object.<anonymous> (/Users/bregard/cartoon-play-api/source/nodejs/.serverless_plugins/plugin-local-invoke.js:3:26)
          at Module._compile (internal/modules/cjs/loader.js:1133:30)
          at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
          at Module.load (internal/modules/cjs/loader.js:977:32)
          at Function.Module._load (internal/modules/cjs/loader.js:877:14)
          at Module.require (internal/modules/cjs/loader.js:1019:19)
          at require (internal/modules/cjs/helpers.js:77:18)
          at requireServicePlugin (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/lib/classes/PluginManager.js:21:14)
          at /usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/lib/classes/PluginManager.js:133:20
          at Array.map (<anonymous>)
          at PluginManager.resolveServicePlugins (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/lib/classes/PluginManager.js:130:8)
          at PluginManager.loadAllPlugins (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/lib/classes/PluginManager.js:117:15)
          at /usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/lib/Serverless.js:101:35
          at tryCatcher (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
          at Promise._settlePromiseFromHandler (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:547:31)
          at Promise._settlePromise (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:18)
          at Promise._settlePromise0 (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10)
          at Promise._settlePromises (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:729:18)
          at Promise._fulfill (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:673:18)
          at Promise._settlePromise (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:617:21)
          at Promise._settlePromise0 (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10)
          at Promise._settlePromises (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:729:18)
          at Promise._fulfill (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:673:18)
          at Promise._resolveCallback (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:466:57)
          at Promise._settlePromiseFromHandler (/usr/local/Cellar/serverless/1.78.1/libexec/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:559:17)
          at Promise._settlePromise (/usr/local/Cellar/server
    Just running serverless --version in my project... any ideas?
    version 6.5.0 of serverless-offline...
    John Noel Victorino
    @jnoelvictorino
    Hello, I have a question about accessing data from a Lambda Function (only without API Gateway) and Lambda Function (behind API Gateway). When I tried to access the JSON payload from behind an API Gateway, I can access it as event.body. But without an API Gateway (directly via Lambda), I can access the JSON payload as event. Would there be a way to access JSON payload as event.body only?
    Kevin Menhinick
    @kevbot-git
    Hi team, does anyone have any tips for contributing to serverless offline? I'm trying to make a test project use my locally-cloned serverless-offline but can't seem to get it to use my builds of it
    If anyone can take me through it I'd be happy to document the process in the Contributing section of the README
    Kevin Menhinick
    @kevbot-git
    Sorry, just found the file that tells me all about that :sweat_smile:
    Kevin Menhinick
    @kevbot-git
    If anyone does get a sec to checkout my small PR, would anyone recommend a way to test what I've changed? I'm struggling to figure out the tests dherault/serverless-offline#1064
    Kamil Dybicz
    @kdybicz
    Hey all! Quick question about an issue raised in dherault/serverless-offline#832 It looks like changes merged as a fix there were at some point reverted https://github.com/dherault/serverless-offline/blob/master/src/ServerlessOffline.js#L269 and it's no longer enough to set private: true on http events to make serverless-offline to generate an print out the x-api-key anymore. Was that done on purpose and I'm just missing something or it's a regression that I can help to patch up?
    Kamil Dybicz
    @kdybicz
    kwongkz
    @kwongkz
    Wanna ask is it serverless-offline after v6 no longer send X-Forwarded-Proto in Lambda-Proxy event request headers?
    David Hérault
    @dherault
    @kwongkz if so please open an issue :)
    @kdybicz merged thanks!
    Kamil Dybicz
    @kdybicz
    :+1:
    Matthew Kelch
    @kelchm
    Has anyone dug into #1080, #1081, #1083? These all seem to be related to changes in #1050
    Matthew Kelch
    @kelchm
    FYI, shared some of the results of my testing with v6.7.0 here: https://github.com/dherault/serverless-offline/issues/931#issuecomment-687234909
    Matthew Kelch
    @kelchm
    I've created a PR to try to address the above: dherault/serverless-offline#1090
    David Hérault
    @dherault
    Thanks @kelchm
    Dustin Goodman
    @dustinsgoodman
    image.png