question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Receiving "The 'path' argument must be of type string. Received type object" during force:source:deploy/retrieve

See original GitHub issue

The full thread of discussion is available here for context:

https://success.salesforce.com/0D53A00004MMUPU

but the short version is that on May 10, 2019, I suddenly started to receive this error when deploying/retrieving metadata against my DE org using force:source:deploy/retrieve:

$ sfdx force:source:deploy -u alias -x manifest/package.xml --json
{
    "status": 1,
    "name": "TypeError [ERR_INVALID_ARG_TYPE]",
    "message": "The \"path\" argument must be of type string. Received type object",
    "exitCode": 1,
    "commandName": "SourceDeployCommand",
    "stack": "TypeError [ERR_INVALID_ARG_TYPE]: The \"path\" argument must be of type string. Received type object\n    at validateString (internal/validators.js:125:11)\n    at Object.join (path.js:427:7)\n    at CustomObjectSubtypeMetadataType.getAggregateMetadataFilePathFromWorkspacePath (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\metadataTypeImpl\\customObjectSubtypeMetadataType.js:29:21)\n    at new _SourceLocations (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceWorkspaceAdapter.js:31:64)\n    at new SourceWorkspaceAdapter (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceWorkspaceAdapter.js:49:28)\n    at SourceDeployApi.doDeploy (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceDeployApi.js:35:20)\nOuter stack:\n    at Function.wrap (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\@salesforce\\core\\lib\\sfdxError.js:151:27)\n    at SourceDeployCommand.catch (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\ToolbeltCommand.js:216:46)",
    "warnings": []
}

If you scroll to the bottom of that thread, I confirmed that the problem occurs against this org via the latest build of the Salesforce CLI from both Windows and Mac, and it does not occur against other orgs that I’ve tried. Whatever is going on seems to be specific to this org which has worked well for me for the past 5-6 years.

The organization ID is 00D610000006x9HEAQ. I’m happy to provide support access to this organization for reproduction purposes. Just let me know when you’re ready for that. Reproduction should be as simple as running:

$ sfdx force:source:retrieve -u <alias> -m 'CustomObject:Account'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pawelhajduk-efcommented, Nov 12, 2019

It happens for me when executing the sfdx force:source:deploy -p <package_path> -u <username> command while having an incorrect directory structure in the package for example:

├── CustomObject__c
├── profiles
|   ├── Profile1.profile-meta.xml
|   └── Profile2.profile-meta.xml

instead of

├── objects
|   └── CustomObject__c
├── profiles
|   ├── Profile1.profile-meta.xml
|   └── Profile2.profile-meta.xml
0reactions
mshanemccommented, Dec 9, 2021

no longer reproducible for me on current plugin-source for the example that @pawelhajduk-ef shared

The error message @SCWells72 sees won’t occur with the new plugin (something else might though if the org is somehow broken). I’ll optimistically close this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I fix sfdx error: "The \"path\" argument must be of type ...
I found that I could do a sfdx force:source:deploy -p [filepath] on individual files and on directories. So, I started at the top...
Read more >
How can I fix sfdx error: The "path" argument must be of type ...
I was getting this error when doing one of the Trailhead modules that had me copy the ldsUtils component into my lwc folder....
Read more >
of a sudden today I'm get the | Salesforce Trailblazer Community
sfdx force:source:deploy -u alias -x manifest/package.xml --json ... "message": "The \"path\" argument must be of type string. Received type object",.
Read more >
typeerror [err_invalid_arg_type]: the "path" argument must be ...
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received an instance of Array.
Read more >
Troubleshooting common AWS CDK issues
When deploying my AWS CDK stack, I receive a NoSuchBucket error ... I get the message --app is required either in command-line, in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found