Closed
Description
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
Type Error ---------------------------------------------
Path must be a string. Received undefined
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Stack Trace --------------------------------------------
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.resolve (path.js:1146:7)
at Object.getTypescriptConfig (./node_modules/serverless-plugin-typescript/src/typescript.ts:96:14)
at ServerlessPlugin.<anonymous> (./node_modules/serverless-plugin-typescript/src/index.ts:122:33)
at Generator.next (<anonymous>)
at ./node_modules/serverless-plugin-typescript/dist/src/index.js:7:71
at __awaiter (./node_modules/serverless-plugin-typescript/dist/src/index.js:3:12)
at ServerlessPlugin.compileTs (./node_modules/serverless-plugin-typescript/dist/src/index.js:99:16)
at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:218:55)
From previous event:
at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:218:22)
at PluginManager.spawn (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:230:17)
at Deploy.BbPromise.bind.then.then (/usr/local/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:101:50)
From previous event:
at Object.before:deploy:deploy [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:99:10)
at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:218:55)
From previous event:
at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:218:22)
at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:237:17)
at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:99:33)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:86:74)
at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless:39:50)
Here's the problematic code I believe:
// disallow overrriding rootDir
if (path.resolve(configParseResult.options.rootDir) !== path.resolve(cwd) && logger) {
logger.log('Warning: "rootDir" from local tsconfig.json is overriden')