Cli: Error running command sfdx.force.source.retrieve.component: data.forEach is not a function

Created on 20 Oct 2020  路  12Comments  路  Source: forcedotcom/cli

I'm receiving the following message when trying to retrieve all metadata (Apex Classes) on my project...

Error running command sfdx.force.source.retrieve.component: data.forEach is not a function. This is likely caused by the extension that contributes sfdx.force.source.retrieve.component.

I have uninstalled and reinstalled everything (Visual Code Studio, Salesforce CLI, Salesforce Extensions for VCS, etc).

I can't find the cause and haven't been able to identify any possible solution or debug path in any of the usual places (i.e. SF Dev guidance documents, github, salesforce stackexchange).

I did find a recent reference to the same issue here: https://salesforce.stackexchange.com/questions/323687/error-running-command-sfdx-force-source-retrieve-component-data-foreach-is-not

Any insight or help would greatly be appreciated.

Thanks

Visual Code Studio
Version: 1.50.1 (user setup)
Commit: d2e414d9e4239a252d1ab117bd7067f125afd80a
Date: 2020-10-13T15:06:15.712Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041

SFDX Plugins
@oclif/plugin-autocomplete 0.2.0
salesforcedx 50.1.1
鈹溾攢 templates 50.1.0
鈹溾攢 @salesforce/sfdx-plugin-lwc-test 0.1.7
鈹溾攢 apex 0.1.1
鈹溾攢 salesforce-alm 50.1.1
鈹斺攢 custom-metadata 1.0.10

duplicate

Most helpful comment

When will this be released? Really need this fix.

All 12 comments

Can you please:

  1. copy/paste the output of sfdx plugins --core
  2. state the exact command you're running with all parameters.
  3. run the command appending --dev-debug and copy/paste the stack trace of the error

@oclif/plugin-autocomplete 0.2.0
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.1 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/analytics 0.22.0
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.2 (core)
analytics 1.12.1 (core)
config 1.1.9 (core)
generator 1.1.3 (core)
salesforcedx 50.1.1
鈹溾攢 templates 50.1.0
鈹溾攢 salesforce-alm 50.1.1
鈹溾攢 @salesforce/sfdx-plugin-lwc-test 0.1.7
鈹溾攢 apex 0.1.1
鈹斺攢 custom-metadata 1.0.10
sfdx-cli 7.76.1 (core)

I'm using Org Browser via the SF Extension pack and the left hand menu item by selecting the pull icon (Retrieve Source from Org). https://developer.salesforce.com/tools/vscode/en/user-guide/org-browser/
image

I haven't figured out how to run a debug log on this specific embedded command (despite attempting).

[2020-10-19 20:57:58.415] [renderer1] [warning] UNRESPONSIVE extension host, 'salesforce.salesforcedx-vscode-core' took 92% of 5610.658ms, saved PROFILE here: 'c:\Users\timma\AppData\Local\Temp\exthost-bfad10.cpuprofile' [{"id":"gc","total":17489,"percentage":0},{"id":"program","total":78,"percentage":0},{"id":"salesforce.salesforcedx-vscode-core","total":5146921,"percentage":92},{"id":"salesforce.salesforcedx-vscode-lightning","total":441766,"percentage":8},{"id":"self","total":4199,"percentage":0}]
[2020-10-19 20:58:07.331] [renderer1] [error] Unable to find sandbox configuration (dw.{json,js})
[2020-10-19 20:58:07.412] [renderer1] [warning] UNRESPONSIVE extension host, 'salesforce.salesforcedx-vscode-lwc' took 87% of 2482.11ms, saved PROFILE here: 'c:\Users\timma\AppData\Local\Temp\exthost-f6ac2e.cpuprofile' [{"id":"program","total":1151,"percentage":0},{"id":"salesforce.salesforcedx-vscode-core","total":273,"percentage":0},{"id":"salesforce.salesforcedx-vscode-lwc","total":2149570,"percentage":87},{"id":"salesforce.salesforcedx-vscode-visualforce","total":310251,"percentage":12},{"id":"self","total":11709,"percentage":0},{"id":"vscode.git","total":8951,"percentage":0}]
[2020-10-19 20:58:09.280] [renderer1] [error] Unable to find sandbox configuration (dw.{json,js})
[2020-10-19 21:04:26.657] [renderer1] [error] Unable to find sandbox configuration (dw.{json,js})

Hey guys. I have the same issue here when I want to retrieve all of the components of a given type (for ex. all triggers, all aura components..). But when retrieving one by one there is no problem. Maybe this data.forEach function is not supported.

I am also seeing this issue when going to the org browser and retrieving all components for a type

The fix for this is going out tomorrow on release v50.2.0 of the Salesforce extensions for VSCode.

Thanks for opening this issue, I'm closing it as a duplicate of issue https://github.com/forcedotcom/salesforcedx-vscode/issues/2634

Thanks!

Was the 50.2.0 release pushed out automatically?

When will this be released? Really need this fix.

This week's release was delayed a bit because of some QA tasks. We released it earlier today to the VSCode marketplace under version 50.2.0 of the Salesforce extensions for VSCode.

Thanks! Things are running smoothly again.

@lcampos Started receiving a similar error last week. More context here

Error running command sfdx.force.source.retrieve.component: undefined. This is likely caused by the extension that contributes sfdx.force.source.retrieve.component.
Was this page helpful?
0 / 5 - 0 ratings