Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invoke local doesn't see CF-variables when serverless-webpack plugin is used #10

Open
ImmaculatePine opened this issue Jan 26, 2018 · 2 comments

Comments

@ImmaculatePine
Copy link

When serverless-webpack plugin is used getEnvDirectory() function called from different hooks returns different values:

  1. afterDeploy hook -> createCFFile() function.
    getEnvDirectory() returns this value:
    /path/to/project/.serverless-resources-env/.us-east-1_dev_functionName
    This path is used to create envs file.

  2. beforeLocalInvoke hook.
    getEnvDirectory() returns this value:
    /path/to/project/.webpack/service/.serverless-resources-env/.us-east-1_dev_functionName
    This path is used to read envs file but it doesn't exist because envs were written to the different directory on the previous step.

@rurri
Copy link
Owner

rurri commented Jun 12, 2018

Thanks for the details. Looks like we can work around this by making a special case for webpack to remove the trailing .webpack

@ShayHaluba
Copy link

Same with "serverless-esbuild" plugin:

  • it creates the env files under /.serverless-resources-env
  • But look for them in /.esbuild/.build/.serverless-resources-env/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants