Cli: no results for sfdx force:source:retrieve -m LightningComponentBundle

Created on 29 Oct 2019  路  14Comments  路  Source: forcedotcom/cli

Summary

Looks like a repeat of #33 and #43
sfdx force:source:retrieve -m LightningComponentBundle returns no results

Steps To Reproduce:

  1. have a non-scratch org with LWC in it that aren't held locally (may be a bug on scratch orgs, too, I just haven't tested that)
  2. sfdx force:source:retrieve -m LightningComponentBundle

Expected result

retrieves the LWCs to local source

Actual result

no results found

VS Code Version:
1.39.2

SFDX CLI Version:
sfdx-cli/7.23.1 darwin-x64 node-v10.16.3
salesforcedx 47.3.7

OS and version:
mac mojave 10.14.6

bug

Most helpful comment

@mshanemc we are creating an internal investigation and will let you know if we have any questions

All 14 comments

@mshanemc we are creating an internal investigation and will let you know if we have any questions

Any workarounds in the meantime to retrieve LightningComponentBundle metadata from a non-scratch org?

hello @brianevanmiller I just tried to reproduce the issue on windows/mac and on scratch orgs and sandboxes and couldn't. Are you still running into this issue? Do you have any steps to reproduce, maybe I missed something?

I still have the issue. Was trying to use a production org and wasn't able to, yesterday.

@mshanemc Do you have more detailed steps to reproduce? I

  1. create LWC via CLI
  2. push/deploy
  3. change the LWC remotely
  4. pull/retrieve the LWC successfully.

what version of the cli are you on? are you on a windows or mac machine? Are you able to mdapi retrieve the LWC?

I've actually got this same issue. I am trying to work on a coworker's code that is out of town. I went to retrieve the lwc folder from source, but it does not retrieve his files for some reason. I've also tried to retrieve the whole project, but it does not pull in his new lwc or aura components. I'd imagine making an entirely new visual studio project would work, but that is not the ideal solution. We are not working in a scratch org, but are working in a standard dev sandbox.

@smcmickleMTM are you using the VScode extensions? or the cli directly?

@williamruemmele-sf I was using the official extension from Salesforce. I found a workaround is to just type in the command in the terminal, which is fine for me. I suppose that means that I was using the extension and now I'm using the CLI directly. Thanks for asking!

@smcmickleMTM Just to clarify, it works in the cli ( in the terminal ) but not if you're using the vscode extensions?

@williamruemmele-sf It still works (retrieves classes) in the terminal if I have the extensions installed, but the extension UI from right clicking and retrieving from source does not retrieve new classes.

@smcmickleMTM Please feel free to correct me if I am misunderstanding.

In VSCode, when using the UI to right click and call 'SFDX: Retrieve Source from Org', it is not expected that new components will be brought into the project.

This is actually what the OrgBrowser was designed to help with. Previously to pull in new source for situations like this, a user would have to modify their manifest file. The OrgBrowser is designed to help developers easily pull in new metadata from the org into their workspace.

Please see below for some documentation. If there are any questions, please don't hesitate to reach out.

Org Browser:
https://developer.salesforce.com/tools/vscode/en/user-guide/org-browser/

Retrieve Background + Manifest Documentation:
https://developer.salesforce.com/tools/vscode/en/user-guide/development-models

@sfsholden
I am expecting to be able to pull in new components with right click folder -> Retrieve Source from Org, however, it currently does not pull in new components when I do so.

@smcmickleMTM Thanks for reaching out. That is the expected behavior. Please have a look at the documentation linked above - it sounds like the Org Browser will be the solution needed for pulling those new components from the Sandbox.

Was this page helpful?
0 / 5 - 0 ratings