-
Notifications
You must be signed in to change notification settings - Fork 11
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
TypeError: Cannot convert undefined or null to object #9
Comments
Hi, the trouble is the plugin is assuming the environnent section is defined for the provider at that line could it be a good idea to default everything to {} ? |
ah !
|
May 2020, PR #10 is still not merged. For now my solution is to stick to exact version 1.3.0. Please, can you comment here. Would you consider fixing this issue for serverless offline users ? |
Hi,
I'm currently trying to use serverless-env-generator but must be doing something wrong, as I'm running into this error
Apparently, the culprit is here:
this.options.environment = Object.assign(this.serverless.service.provider.environment, environment, dotenv.config({ path: path.join(config.servicePath, '.env.local') }).parsed)
and this.serverless.service.provider.environment is undefined...
Here my package.json:
I currently have a .env :
USER_BACKEND_DOMAIN=http://
and my environment.yml :
dev:
USER_BACKEND_DOMAIN: 'http:///'
After intialising the project, I run
sls env --attribute USER_BACKEND_DOMAIN --value "http://<IP-address>/" --stage dev
Then:
sls env create
Then I create my .env again (since it gets deleted by the "create" command
Finally, I run
sls offline start
and get the error mentioned. I also tried sls offline start --stage dev but I get the same output.
Where am I going wrong ?
Thanks
The text was updated successfully, but these errors were encountered: