Serverless-offline: Handler path with dot in folder can't find handler

Created on 28 Apr 2017  路  4Comments  路  Source: dherault/serverless-offline

If a folder in the multi-folder path to a handler contains a dot the handler won't be found.

Example:

functions:
  my_fn:
    handler: main.out/my_fn.handler"
    events:
      - http:
          path: my_fn
          method: get

Running with:

SLS_DEBUG=* serverless offline --location /path/to/project/

Produces the logs:

...
[offline] Loading handler... (/path/to/project/main)
...

Where it clearly truncates the rest of the handler path after the dot.

This is especially critical in projects where compilation occurs and the target output path may contain dots and can't be controlled outside of the compilation tool.

Most helpful comment

Merged! v3.25.8

All 4 comments

The bug is in the getFunctionOptions function in the functionHelper.js file. It searches for only the first dot in the handler path instead of the last dot. Very annoying, a fix would be highly appreciated. Thank you.

Merged! v3.25.8

Thanks @dherault !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattmeye picture mattmeye  路  4Comments

FranzSkuffka picture FranzSkuffka  路  3Comments

Rafaelsk picture Rafaelsk  路  4Comments

davidroman0O picture davidroman0O  路  4Comments

adambiggs picture adambiggs  路  4Comments