alixaxel / chrome-aws-lambda

Chromium Binary for AWS Lambda and Google Cloud Functions
MIT License
3.2k stars 292 forks source link

[BUG] IS_LOCAL=false treated as if it is indeed local #247

Open ghost opened 2 years ago

ghost commented 2 years ago

Expected Behavior

When process.env.IS_LOCAL=false run the script as if it is not local (e.g. on AWS Lambda)

Current Behavior

When process.env.IS_LOCAL=false running on AWS Lambda the Chrome executable fails to run because headless is set false and thus chromium.executablePath returns null.

Steps to Reproduce

Set the environment variable IS_LOCAL to "false" and run on AWS Lambda.

Possible Solution

Our workaround was to change our code from using IS_LOCAL to IS_LOCAL_ENV. Ideally a check for IS_LOCAL="false" could be added in the code as to not confuse other people like me in the future for hours. 😄

ianduvall commented 2 years ago

Looks like the implementation checks if process.env.IS_LOCAL !== undefined so you should be able to omit IS_LOCAL to achieve IS_LOCAL=false.