AnomalyInnovations / serverless-bundle

Optimized packages for ES6 and TypeScript Node.js Lambda functions without any configuration.
https://serverless-stack.com/chapters/package-lambdas-with-serverless-bundle.html
MIT License
536 stars 157 forks source link

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

Open pavannaik028 opened 3 years ago

pavannaik028 commented 3 years ago

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

ivan-ciger-tms commented 3 years ago

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

jayair commented 3 years ago

@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?