Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when no Lambda function: TypeError [ERR_INVALID_ARG_TYPE]: The 'path' argument must be of type string, Buffer, or URL #842

Open
3 tasks done
junah201 opened this issue Jun 26, 2024 · 1 comment

Comments

@junah201
Copy link

junah201 commented Jun 26, 2024

Are you certain it's a bug?

  • Yes, it looks like a bug

Are you using the latest plugin release?

  • Yes, I'm using the latest plugin release

Is there an existing issue for this?

  • 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
@satpai1215
Copy link

Just bumping this as I'm running into the same issue.

It looks like it was fixed with the update in #843 , however is this going to get released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants