Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Locally invoked functions clear webpack compiled code needed for functions which are called from locally invoked function #275
This is a Bug Report
When invoking a local function which publishes to an SNS topic, the called lambda function which is subscribed to the SNS topic fails due to the webpack compiled code being removed during the local invocation. This issue is only during local development, and using serverless-offline-sns.
Example repository to highlight the issue: https://github.com/todda00/serverless-offline-sns-example/tree/webpack-local-invoke-issue
Steps to reproduce:
npm install npm start
And then go to http://localhost:3000/ping to trigger the event, you should see "pong" appear in the console.
To see the issue with webpack, open a new command line (while serverless offline is still running) and run:
serverless invoke local -f ping
You will see the trace error in the terminal where serverless offline is running.
The .webpack folder is cleared out during validation and is only compiling the locally invoked function (ping), but the running offline instance needs the pong handler, which has been removed.
For bug reports:
Similar or dependent issue(s):
Hi @todda00 , thanks for reporting
I have an idea to solve the problem. If you run
We could introduce a switch for
@todda00 What do you think of this approach?
I'll add the switch then for these use cases that allows executing a function out of a currently running offline compile. Please let me know if you have any better idea for the switch name - I'm not good in finding names
If it is not compiling at all, then perhaps --webpack-no-compile would be applicable.…
On Tue, Nov 14, 2017 at 5:26 PM, Frank Schmid ***@***.***> wrote: I'll add the switch then for these use cases that allows executing a function out of a currently running offline compile. Please let me know if you have any better idea for the switch name - I'm not good in finding names