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.
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 !
Most helpful comment
Merged! v3.25.8