force:source:push and force:source:deploy --tracksource error out with "The "path" argument must be of type string. Received undefined" when files inside StaticResource application/zip folder are forceignored
Summary
StaticResource application/zip folders with forceignored files result in this same unhelpful cryptic error:
% sfdx force:source:push -f
*** Pushing v52.0 metadata with SOAP API v54.0 connection ***
DEPLOY PROGRESS | ████████████████████████████████████████ | 1/1 Components
ERROR running force:source:push: The "path" argument must be of type string. Received undefined
Updating source tracking... done
% sfdx force:source:deploy -p src/path/to/staticresources/someStaticResource -t -f
*** Deploying v52.0 metadata with SOAP API v54.0 connection ***
Deploy ID: 0AfJ000002AFWHQKA5
DEPLOY PROGRESS | ████████████████████████████████████████ | 1/1 Components
ERROR running force:source:deploy: The "path" argument must be of type string. Received undefined
Updating source tracking... done
Steps To Reproduce:
Repository/branch to reproduce: my dreamhouse-lwc
- Create a decomposed StaticResource application/zip folder and resource-meta.xml as shown in the linked branch above with one file inside the folder with a file type that is safe to forceignore.
- Add the file or even more generally the file type to forceignore.
- Run
sfdx force:source:pushorsfdx force:source:deploy -p path/to/staticresource -t - Get the error
ERROR running force:source:push(or deploy): The "path" argument must be of type string. Received undefined
Expected result
Similar to when the folder is empty, I would expect an error that points out that a specific StaticResource zip folder is empty. Ideally, it would be nice if the solution to this problem more specifically points out that the StaticResource zip folder would be empty because the file inside is being forceignored.
Actual result
This very unhelpful error that required me to step through each top level folder and down the directory tree to determine which file was the culprit. Ideally, nobody else should suffer through this again. Running --loglevel debug on the commands did not produce any more useful log errors. Even though it says updating source tracking. Source tracking does not actually update since all the files still try to push on the next run.
ERROR running force:source:push(or deploy): The "path" argument must be of type string. Received undefined
System Information
{ "cliVersion": "sfdx-cli/7.150.0", "architecture": "darwin-x64", "nodeVersion": "node-v14.19.2", "pluginVersions": [ "@oclif/plugin-autocomplete 0.3.0 (core)", "@oclif/plugin-commands 1.3.0 (core)", "@oclif/plugin-help 3.3.1 (core)", "@oclif/plugin-not-found 1.2.6 (core)", "@oclif/plugin-plugins 1.10.11 (core)", "@oclif/plugin-update 1.5.0 (core)", "@oclif/plugin-warn-if-update-available 1.7.3 (core)", "@oclif/plugin-which 1.0.4 (core)", "@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)", "alias 2.0.0 (core)", "apex 0.11.0 (core)", "auth 2.0.2 (core)", "community 1.1.4 (core)", "config 1.4.6 (core)", "custom-metadata 1.1.0 (core)", "data 0.6.15 (core)", "generator 2.0.0 (core)", "info 2.0.0 (core)", "limits 2.0.0 (core)", "org 1.12.1 (core)", "salesforce-alm 54.3.0 (core)", "schema 2.1.0 (core)", "sfdx-cli 7.150.0 (core)", "signups 1.0.0 (core)", "source 1.9.7 (core)", "telemetry 1.4.0 (core)", "templates 54.6.0 (core)", "trust 1.1.0 (core)", "user 1.7.1 (core)" ], "osVersion": "Darwin 20.6.0" }
Additional information
This issue seems specific to the new source tracking. Legacy push did not encounter the issue and deploy only encounters the issue with the --tracksource option.
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
This issue has been linked to a new work item: W-11148485
yeah, that is annoying. Thanks for the repro/explanation.
Same thing is happening to me.