Open theGlenn opened 5 years ago
i am getting the same issue when trying to refer to ${self} yml block ex: block i am refferring to:
custom:
authorizerConfig:
name: authorize
type: request
identitySource: method.request.header.Authorization, context.path, context.httpMethod
my reference:
functions:
authorize:
handler: security.authorize
invoke:
handler: service.invoke
events:
- http:
path: entity
method: GET
cors: true
authorizer: ${self:custom.authorizerConfig}
with SLS_DEBUG='*'
i get the following stacktrace:
TypeError: Cannot read property 'split' of undefined
at _.values.map.map.h (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/src/typescript.ts:53:31)
at Array.map (<anonymous>)
at Object.extractFileNames (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/src/typescript.ts:52:6)
at TypeScriptPlugin.get rootFileNames [as rootFileNames] (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/src/index.ts:71:23)
at TypeScriptPlugin.<anonymous> (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/src/index.ts:132:51)
at Generator.next (<anonymous>)
at /home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/dist/src/index.js:7:71
at new Promise (<anonymous>)
at __awaiter (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/dist/src/index.js:3:12)
at TypeScriptPlugin.compileTs (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/dist/src/index.js:103:16)
at TypeScriptPlugin.<anonymous> (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/src/index.ts:35:20)
at Generator.next (<anonymous>)
at /home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/dist/src/index.js:7:71
at new Promise (<anonymous>)
at __awaiter (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/dist/src/index.js:3:12)
at Object.before:offline:start [as hook] (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless-plugin-typescript/src/index.ts:34:31)
at BbPromise.reduce (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless/lib/classes/PluginManager.js:391:55)
From previous event:
at PluginManager.invoke (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless/lib/classes/PluginManager.js:391:22)
at PluginManager.run (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless/lib/classes/PluginManager.js:422:17)
at variables.populateService.then.then (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless/lib/Serverless.js:157:33)
at processImmediate (timers.js:632:19)
at process.topLevelDomainCallback (domain.js:120:23)
From previous event:
at Serverless.run (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless/lib/Serverless.js:144:8)
at serverless.init.then (/home/abetaev/documents/dev/nm/universal-cart/node_modules/serverless/bin/serverless:44:28)
@abetaev I'm in the same trouble!
Any ideas of how to fix this?
Had the same issue, but it was just misprint in handler
keyword under function name.
I had the same issue, and it was me spelling handler
as hander
in my yaml file.
I wish the error reporting was clearer on this, since it wasn't related at all to something a dev can recognize and trace
When splitting config into different files and referencing them through the following pattern —see below— plugin throws
Cannot read property 'split' of undefined
.Full stacktrace: