Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving LWC Component Bundle throws error "An object 'X' of type LightningComponentBundle was named in package.xml, but was not found in zipped directory" #2375

Closed
molsi01 opened this issue Jul 24, 2020 · 3 comments

Comments

@molsi01
Copy link

molsi01 commented Jul 24, 2020

Summary

Making a change to .js file of an LWC Component Bundle will not allow a Save & Deploy when using CMD & S (File / Save) or ALT & CMD & S (File / Save All). When attempting this, an error is thrown:
"An object 'X' of type LightningComponentBundle was named in package.xml, but was not found in zipped directory"
Using the manual 'SFDX:Deploy Source to Org' on the .js file, via the menus (or right click on the file) works.
Saving the .html file does work as expected using CMD & S

Steps To Reproduce:

  1. Create a new LWC in VS Code
  2. Add a simple component to the .html file with an onchange event
  3. Add a simple onchange handler to the .js file to console.log some output
  4. Save all components using ALT & CMD & S
  5. Error is produced
  6. Manually run SFDX:Deploy Source to Org (right click on .js file)
  7. Save & deploy works

Expected result

Using CMD & S or ALT & CMD & S should save & deploy changes. If editing just the .js file, using CMD & S should save & deploy the .js file

Actual result

.js file is not deployed and error above is thrown

Additional information

Feel free to attach a screenshot.

VS Code Version:
1.47.2

SFDX CLI Version:
7.66.2

OS and version:
MAC OS 10.15.5

@git2gus
Copy link

git2gus bot commented Jul 28, 2020

This issue has been linked to a new work item: W-7883112

@trinasfdx trinasfdx assigned mohanraj-r and jeffb-sfdc and unassigned mohanraj-r Mar 23, 2022
@trinasfdx trinasfdx added the status:in review pr/issue is being reviewed label Apr 1, 2022
@jeffb-sfdc jeffb-sfdc added status:duplicate and removed status:in review pr/issue is being reviewed labels Apr 1, 2022
@jeffb-sfdc jeffb-sfdc added status:in review pr/issue is being reviewed and removed status:duplicate labels Apr 1, 2022
@jeffb-sfdc jeffb-sfdc reopened this Apr 1, 2022
@jeffb-sfdc
Copy link
Contributor

@molsi01 I attempted to reproduce this but wasn't able to. Here's what I did: I created a LWC class and in the JS file added:

import { LightningElement } from 'lwc';

export default class LwcExample extends LightningElement {
  numberFieldValue;

  handleNumberChange(event) {
    console.log('handleNumberChange() was called');
  }
}

...and in the HTML file I added:

<template>
  <lightning-input
    type="number"
    onchange={handleNumberChange}
    label="Enter a number">
  </lightning-input>
</template>

I then saved (using CMD-S) but I didn't get any errors.

Are you still able to reproduce this? If so, are there different steps needed to reproduce this?

@jeffb-sfdc jeffb-sfdc removed their assignment Apr 1, 2022
@jeffb-sfdc jeffb-sfdc removed the status:in review pr/issue is being reviewed label Apr 1, 2022
@no-response
Copy link

no-response bot commented Apr 8, 2022

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

@no-response no-response bot closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants