Cli: functions: don't allow requiring shared/external folders

Created on 4 Jun 2019  路  4Comments  路  Source: netlify/cli

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?

netlify dev allows functions requiring external modules because it is just node. but netlify prod doesn't. so we should disable this or warn very loudly.

https://community.netlify.com/t/requiring-modules-external-to-functions-directory/1231/2

area dev functions bug

Most helpful comment

+1 would be great to see this functionality, functions end up duplicated a lot of code if not.

All 4 comments

bump cc @raeesbhatti

here's a repro! https://github.com/sw-yx/repro-shared-functions-bug

+1 would be great to see this functionality, functions end up duplicated a lot of code if not.

feel free to tackle it if you have an idea how to do it @revett this has not been prioritzed at all

im thinking maybe mess with node module resolution in netlify dev on a per function basis

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrlubos picture mrlubos  路  5Comments

bendg25 picture bendg25  路  5Comments

KazakovKirill picture KazakovKirill  路  4Comments

karl-cardenas-coding picture karl-cardenas-coding  路  3Comments

designbuedchen picture designbuedchen  路  5Comments