TypeError: Cannot read properties of undefined (reading 'split')
i'm trying to deploy docker image through sls
functions:
generatePdf:
# handler: src/api/generate.pdf
images: 498157479666.dkr.ecr.ap-southeast-1.amazonaws.com/automate-pdf:latest@sha256:98e17f123e538564dff238122cc31ab38ddf1e735e4cc5f7be853cc2cc5e1dee
description: A lambda handler that generates PDF file from payload data and upload it to S3 bucket.
memorySize: 2048
provisionedConcurrency: 2
events:
- http:
path: pdf
method: POST
cors: true
documentation:
summary: Generates PDF from payload
tags:
- generatePdfS3
it works perfectly with handler but the moment i switch to images, it throws this weird error
TypeError: Cannot read properties of undefined (reading 'split')
at /Users/rijwan/code/second/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/typescript.js:57:33
at Array.map (<anonymous>)

my sls version is as below:
Framework Core: 3.22.0
Plugin: 6.2.2
SDK: 4.3.2
any update?
still getting error
❯ sls deploy --verbose
Running "serverless" from node_modules
Deploying pdf-api to stage dev (ap-southeast-1)
Packaging
Compiling with Typescript...
Using local tsconfig.json - tsconfig.json
✖ Stack pdf-api-dev failed to deploy (0s)
Environment: darwin, node 12.16.3, framework 3.22.0 (local) 3.22.0v (global), plugin 6.2.2, SDK 4.3.2
Credentials: Local, "default" profile
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
TypeError: Cannot read property 'split' of undefined
at /Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/typescript.js:57:33
at Array.map (<anonymous>)
at Object.extractFileNames (/Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/typescript.js:56:10)
at TypeScriptPlugin.get rootFileNames [as rootFileNames] (/Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/index.js:102:27)
at TypeScriptPlugin.<anonymous> (/Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/index.js:159:59)
at Generator.next (<anonymous>)
at /Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/index.js:8:71
at new Promise (<anonymous>)
at __awaiter (/Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/index.js:4:12)
at TypeScriptPlugin.compileTs (/Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/index.js:143:16)
at TypeScriptPlugin.<anonymous> (/Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/index.js:58:28)
at Generator.next (<anonymous>)
at /Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/index.js:8:71
at new Promise (<anonymous>)
at __awaiter (/Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/index.js:4:12)
at before:package:createDeploymentArtifacts (/Users/rijwan/code/automate-pdf-api/node_modules/serverless-plugin-typescript/dist/src/index.js:57:63)
at PluginManager.runHooks (/Users/rijwan/code/automate-pdf-api/node_modules/serverless/lib/classes/plugin-manager.js:530:15)
at PluginManager.invoke (/Users/rijwan/code/automate-pdf-api/node_modules/serverless/lib/classes/plugin-manager.js:563:20)
at async PluginManager.spawn (/Users/rijwan/code/automate-pdf-api/node_modules/serverless/lib/classes/plugin-manager.js:585:5)
at async before:deploy:deploy (/Users/rijwan/code/automate-pdf-api/node_modules/serverless/lib/plugins/deploy.js:40:11)
at async PluginManager.runHooks (/Users/rijwan/code/automate-pdf-api/node_modules/serverless/lib/classes/plugin-manager.js:530:9)
at async PluginManager.invoke (/Users/rijwan/code/automate-pdf-api/node_modules/serverless/lib/classes/plugin-manager.js:563:9)
at async PluginManager.run (/Users/rijwan/code/automate-pdf-api/node_modules/serverless/lib/classes/plugin-manager.js:604:7)
at async Serverless.run (/Users/rijwan/code/automate-pdf-api/node_modules/serverless/lib/serverless.js:174:5)
at async /Users/rijwan/code/automate-pdf-api/node_modules/serverless/scripts/serverless.js:771:9
2 deprecations found: run 'serverless doctor' for more details
Seems to me node 17 doesn't supported by aws
I've run into the same issue, lambda fails when you try to use any import.. ( Node 17 is not in the picture at all. I've tried it with 12 and 14. ) Tried both the 2.1.4 and the 2.1.2 version of the plugin...
Switched to serverless-esbuild and the issue went away.
@mdrijwan Running into this myself now, did you ever have any luck resolving this?