serverless / serverless-plugin-typescript

Serverless plugin for zero-config Typescript support
MIT License
783 stars 223 forks source link

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

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:

Thank you

Marcosl14 commented 1 year ago

I only get this error when working with layers (for the entire node_modules) and try to deploy only one function... No problems to deploy the entire stack... No problems when not using layers, to deploy a single function...

nbcchen commented 1 year ago

@Marcosl14

Did you have serverless.yml and tsconfig.json in different locations? I do and I can't make it work at all

Marcosl14 commented 1 year ago

No... They are in the same location...