serverless-bundle icon indicating copy to clipboard operation
serverless-bundle copied to clipboard

[ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

Open pavannaik028 opened this issue 4 years ago • 2 comments

Hi All,

we are seeing the error "[ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined" after adding the serverless-bundle plugin.

error stack: erverless: Auto instrumenting functions with Datadog Serverless: Adding Lambda Layers to functions Serverless: Compiling with Typescript... Serverless: Using local tsconfig.json Serverless: Typescript compiled. Serverless: Invoke webpack:validate Serverless: Invoke webpack:compile Serverless: Bundling with Webpack... Serverless: Invoke webpack:package Serverless: No external modules needed Serverless: Packaging service...

Type Error ---------------------------------------------

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at new NodeError (node:internal/errors:277:15) at validateString (node:internal/validators:123:11) at Object.basename (node:path:1156:5) at TypeScriptPlugin. (node_modules/serverless-plugin-typescript/src/index.ts:203:12) at Generator.next () at fulfilled (node_modules/serverless-plugin-typescript/dist/src/index.js:4:58) From previous event: at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:521:22) at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:556:24 From previous event: at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:556:8) at /usr/local/lib/node_modules/serverless/lib/Serverless.js:203:33 at processImmediate (node:internal/timers:463:21) From previous event: at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:190:74) at /usr/local/lib/node_modules/serverless/scripts/serverless.js:50:26

in serverless.yml

plugin:

serverless-plugin-typescript serverless-plugin-datadog serverless-plugin-include-dependencies serverless-dependson-plugin serverless-offline serverless-bundle

Thank you

pavannaik028 avatar Jan 21 '21 06:01 pavannaik028

I'm experiencing the same issue. Are there any updates?

ivan-ciger-tms avatar Apr 21 '21 07:04 ivan-ciger-tms

@pavannaik028 From the stack trace it is pointing to a different plugin node_modules/serverless-plugin-typescript/src/index.ts. Are you sure it is caused by the bundle plugin?

jayair avatar Apr 21 '21 18:04 jayair