I'm currently trying to use serverless-env-generator but must be doing something wrong, as I'm running into this error
TypeError: Cannot convert undefined or null to object
at Function.assign (<anonymous>)
at helper.getEnvVars.then.envFiles (/Users/frix00/Sites/betility/betility-graphql/node_modules/serverless-env-generator/src/index.js:120:41)
From previous event:
at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:464:22)
at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:496:17)
at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:116:33)
at runCallback (timers.js:693:18)
at tryOnImmediate (timers.js:664:5)
at processImmediate (timers.js:646:5)
at process.topLevelDomainCallback (domain.js:121:23)
From previous event:
at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:103:74)
at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless.js:52:28)
at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:111:16
at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:139:20)
From previous event:
at initializeErrorReporter.then (/usr/local/lib/node_modules/serverless/bin/serverless.js:52:6)
at runCallback (timers.js:693:18)
at tryOnImmediate (timers.js:664:5)
at processImmediate (timers.js:646:5)
at process.topLevelDomainCallback (domain.js:121:23)
From previous event:
at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless.js:38:39)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:266:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
and this.serverless.service.provider.environment is undefined...
{
"name": "betility-graphql",
"version": "1.2.0",
"description": "Grpah QL Layer for Betility",
"main": "graphql.js",
"lint-staged": {
"*.{json,css,md}": [
"prettier --write",
"git add"
],
"*.js": [
"prettier --write",
"eslint --fix",
"git add"
]
},
"scripts": {
"precommit": "lint-staged",
"lint": "eslint .",
"startcache": "serverless offline start --skipCacheInvalidation",
"start": "serverless offline start",
"pretest": "npm run lint",
"test": "jest --coverage",
"test:watch": "npm test -- --watch"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]:ccinvest/betility-graphql.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"homepage": "https://bitbucket.org/monamourdecomptable/backend-guideline#readme",
"dependencies": {
"apollo-server-lambda": "^2.8.1",
"axios": "^0.19.0",
"dotenv": "^8.0.0",
"graphql": "^14.4.2"
},
"devDependencies": {
"aws-sdk": "^2.454.0",
"eslint": "^5.5.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.21.0",
"eslint-plugin-prettier": "^2.6.2",
"husky": "^0.14.3",
"jest": "^23.5.0",
"lint-staged": "^7.2.2",
"prettier": "^1.14.2",
"serverless": "^1.30.1",
"serverless-domain-manager": "^3.2.6",
"serverless-env-generator": "^1.4.1",
"serverless-offline": "^5.9.0",
"serverless-plugin-warmup": "^4.7.0-rc.1"
}
}
and get the error mentioned. I also tried sls offline start --stage dev but I get the same output.