serverless-python-requirements
serverless-python-requirements copied to clipboard
Error when no Lambda function: TypeError [ERR_INVALID_ARG_TYPE]: The 'path' argument must be of type string, Buffer, or URL
Are you certain it's a bug?
- [X] Yes, it looks like a bug
Are you using the latest plugin release?
- [X] Yes, I'm using the latest plugin release
Is there an existing issue for this?
- [X] I have searched existing issues, it hasn't been reported yet
Issue description
When no Lambda function, serverless-python-requirement
receive TypeError.
I know that this is not a common use case. But serverless-python-requirement
should handle these exceptions.
I will add a PR related to this issue soon.
Service configuration (serverless.yml) content
service: sls-bug-test
provider:
name: aws
runtime: python3.10
region: ap-northeast-2
package:
include:
- "requirements.txt"
exclude:
- "node_modules/**"
plugins:
- serverless-python-requirements
Command name and used flags
sls deploy
Command output
✖ The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
at readFile (node:fs:409:10)
at go$readFile (file:///C:/Users/junah/.serverless/releases/4.1.6/package/dist/sf-core.js:3:1334)
at readFile8 (file:///C:/Users/junah/.serverless/releases/4.1.6/package/dist/sf-core.js:3:1244)
at go$readFile (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\graceful-fs\graceful-fs.js:118:14)
at Object.readFile (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\graceful-fs\graceful-fs.js:115:12)
at Object.readFile (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\universalify\index.js:5:57)
at Object.tryCatcher (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\util.js:16:23)
at Object.ret [as readFileAsync] (eval at makeNodePromisifiedEval (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:14:23)
at injectRequirements (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\serverless-python-requirements\lib\inject.js:30:6)
at ServerlessPythonRequirements.injectAllRequirements (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\serverless-python-requirements\lib\inject.js:169:13)
at ServerlessPythonRequirements.<anonymous> (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\serverless-python-requirements\index.js:243:43)
at ServerlessPythonRequirements.tryCatcher (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\async.js:102:5)
at Async.drainQueues [as _onImmediate] (C:\Users\junah\OneDrive\바탕 화면\sls bug test\node_modules\bluebird\js\release\async.js:15:14)
at process.processImmediate (node:internal/timers:476:21)
For help, try the following:
• Run the command again with the "--debug" option
• Run "serverless support"
• Review the docs: https://www.serverless.com/framework/docs/
Environment information
serverless framework = 4.1.6
serverless-python-requirements = 6.1.0