Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    David Hérault
    @dherault
    Hi there!
    Richard Tan
    @chardos
    Bonjour!
    Kevin Menhinick
    @kevbot-git
    Hey there! Has anyone perhaps played with the WebSocket features?
    I've got a service running offline managing to send responses, but I'm hoping to be able to use a Route Selection Expression in serverless.yml to tell serverless where to send responses to.
    The documentation on AWS isn't very helpful on this topic!
    Cheers :)
    David Hérault
    @dherault
    I've created the plugin but only supervised the websocket part, so I cannot help. Try opening a GitHub issue. Best
    James Ingold
    @james-ingold
    Hey David, just wanted to say thanks for all your work on this plugin! Glad there's a gitter chat
    Richard Tan
    @chardos

    Hey Peeps,

    Just created a new project, and returned a string from my lambda which works fine in serverless-offline.

    When I deployed my lambda it threw a 500 because it expects an object to be returned with statusCode and body. Should we emulate this behaviour in serverless-offline?

    Could give a nice error message, to improve the developer experience
    Austin G
    @Stegosource_twitter
    Does anyone know if there is a way to remove or not include the "access-control-allow-origin" header? I have my serverless functions behind an NGINX proxy and the "access-control-allow-origin" is already handled there. As a result, there is a conflict, and the browser doesn't like it
    Richard Tan
    @chardos
    @Stegosource_twitter Not sure off the top of my head I will attempt to look at this early next week
    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...