GoogleCloudPlatform / functions-framework-nodejs

FaaS (Function as a service) framework for writing portable Node.js functions
Apache License 2.0
1.29k stars 158 forks source link

fix: remove default fallback when target function does not exist #497

Closed garethgeorge closed 1 year ago

garethgeorge commented 1 year ago

The function framework's current behavior is to load an exported function named 'function' if one exists as a fallback if the user's declared target function is not found. This behavior is counter intuitive and can hide misconfiguration from the user.

In this CL a breaking change is made to disable this fallback behavior in favor of failing fast so that the configuration error is highly visible to the user.

garethgeorge commented 1 year ago

Done, I wasn't sure if we might want to prevent users from updating to the new behavior. I suspect very few customers are depending on this behavior as it is not part of the contract & is not very expected.