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.

ERROR running force:source:retrieve: Cannot read property 'getWorkspaceElements' of undefined

See original GitHub issue

Summary

Created a project with manifest and tried to retrieve Wave (Einstein Analytics) components in order to setup source control and CI/CD with them, however, I’m receiving an error in the output.

I am using the sample Developer Edition org provided in Trailhead, so the issue should be easy to reproduce.

Steps To Reproduce:

  1. Create a new Developer Edition org with Einstein Analytics enabled - https://developer.salesforce.com/promotions/orgs/analytics-de
  2. SFDX: Create Project with Manifest
  3. SFDX: Authorize an Org from step 1.
  4. Change the manifest/package.xml content with below
  5. Right click on package.xml and execute SFDX: Retrieve Source in Manifest from Org
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>WaveApplication</name>
    </types>
    <types>
        <members>*</members>
        <name>WaveDashboard</name>
    </types>
    <types>
        <members>*</members>
        <name>WaveDataflow</name>
    </types>
    <types>
        <members>*</members>
        <name>WaveDataset</name>
    </types>
    <types>
        <members>*</members>
        <name>WaveLens</name>
    </types>
    <types>
        <members>*</members>
        <name>WaveRecipe</name>
    </types>
    <types>
        <members>*</members>
        <name>WaveXmd</name>
    </types>
    <types>
        <members>*</members>
        <name>WaveTemplateBundle</name>
    </types>
    <version>45.0</version>
</Package>

Expected result

All Wave* components from the org should have been retrieved, and the command should exit with code 0 (i.e. without any errors).

Actual result

Some (or all? Not sure how to verify.) wave components get retrieved into force-app/main/default/wave and force-app/main/default/waveTemplates folders, the command exits with code 1 and the below error is reported in the output:

14:50:36.562 sfdx force:source:retrieve --manifest f:\SF\test\manifest\package.xml
ERROR running force:source:retrieve:  Cannot read property 'getWorkspaceElements' of undefined
14:50:50.842 sfdx force:source:retrieve --manifest f:\SF\test\manifest\package.xml ended with exit code 1

VS Code Version:

Version: 1.33.0 (system setup) Commit: 0dd516dd412d42323fc3464531b1c715d51c4c1a Date: 2019-04-04T15:14:28.026Z Electron: 3.1.6 Chrome: 66.0.3359.181 Node.js: 10.2.0 V8: 6.6.346.32 OS: Windows_NT x64 10.0.17763

SFDX CLI Version:

bash-4.3$ sfdx -v
sfdx-cli/7.3.0-94ecf2d5ee win32-x64 node-v10.15.3

OS and version:

Microsoft Windows 10 Pro 10.0.17763

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:32

github_iconTop GitHub Comments

4reactions
geraemartinezcommented, Oct 1, 2019

if you have this in your package.xml it does n’t work

<types>
        <members>*</members>
        <name>ApexTestSuite</name>
</types>

but it was working…

1reaction
AQTectoniccommented, Sep 24, 2019

I am also getting the same error while running sfdx force:source:retrieve -x Package.xml

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR running force:source:retrieve: Cannot read property ...
Status: FAILEDMessage: TypeError Cannot read property 'getWorkspaceElements' of undefined; If you remove the XML node with the CustomField, ...
Read more >
ERROR running force:source:retrieve: Cannot read property ...
ERROR running force:source:retrieve : Cannot read property 'id' of undefined. I have recreated the project repository and tried this again, ...
Read more >
How could i retrieve metadata from - Trailhead - Salesforce
ERROR running force:source:retrieve : Cannot read properties of undefined (reading 'types'). Preparing retrieve request... done.
Read more >
Salesforce CLI - SFDX - Cannot read properties of undefined ...
When running the command that makes the login against our Sandbox org, it redirects to a localhost URL and then it display an...
Read more >
Cannot read property 'getInstance' of undefined in Salesforce ...
I am able to resolve by uninstalling and reinstalling the Salesforce CLI from installed program on machine. Uninstall Salesforce CLI from ...
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