1

tl;dr - how to make sure Retrieve Source from Org includes XML file

Description

Normally when I retrieve source data for an LWC from an org in vs code the resulting file looks like this:

enter image description here

For some reason now when I retrieve them it looks like this:

enter image description here

The HTML and JavaScript files are in their own separate files, and the js-meta.xml file is missing.

Furthermore, when I make changes to the HTML or JavaScript file and attempt to run the SFDX: Deploy This Source to Org command, I encounter the following error:

Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\ME\AppData\Local\Temp\sdx_sourceDeploy_pkg_1616179398177\lwc\adminControlPanel\adminControlPanel.html'

As a result I am unable to work on LWC files at this time.

Question How to make sure Retrieve Source from Org for LWC files includes the XML file?

Attempted Fixes

  • Restart Visual Studio Code
  • Uninstall and reinstall Salesforce Extension Pack
  • Reauthorize org
  • Update Visual Studio Code
  • Reinstall SFDX
  • Start a new project with manifest

I have also searched online for this error via github tickets, stack exchange, and other sites, but have not found a solution.

2
  • First question: why are the adminControlPanel JS and HTML files in directories of the same name?! Something went horribly wrong when VSCode retrieved this LWC in the first place... – Phil W Mar 19 at 19:27
  • No idea, and agreed - something was seriously broken – Jwok Mar 19 at 20:12
0

While I don't know exactly what the solution was, completing the following steps (in this order) seems to have resolved the issues:

  1. Uninstall and reinstall the Salesforce CLI
  2. Uninstall and reinstall VisualForce
  3. Uninstall and reinstall the Salesforce Extension Pack
  4. Start a new project
  5. Log out of all authorized orgs and re-log into the org

I suspect that #5 may have been the key, but I wasn't able to isolate it in the process and can't confirm for sure.

I'm not going to mark this as "the solution" because I don't know exactly what did it, but hopefully this is helpful to anyone encountering this problem in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.