forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
954 stars 406 forks source link

Meta XML file for LWC quick action component firing an error for actionType attribute, which is a valid attribute #3339

Closed rahulgawale closed 2 years ago

rahulgawale commented 3 years ago

Summary

I am developing a quick action with LWC and I have the below meta XML file for that.

<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>52.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordAction</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordAction">
            <actionType>Action</actionType>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

I am able to successfully deploy the component to an org but, VS Code is showing an error as below:

Invalid element name:
 - actionType

One of the following is expected:
 - hasStep
 - objects
 - property
 - propertyType
 - supportedFormFactors

Error indicated by:
 {http://soap.sforce.com/2006/04/metadata}
with code:

This error is not expected from the linter.

Steps To Reproduce:

  1. Create the SFDX project with manifest in VS Code for any salesforce developer org which is in Summer 2021.
  2. Create one lightning web component
  3. Add the below code in the meta-xml file of the newly created LWC.
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordAction</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordAction">
            <actionType>Action</actionType>
        </targetConfig>
    </targetConfigs>

Expected result

The error should not be fired in VS Code

Actual result

Showing the below error in VS Code.

Invalid element name:
 - actionType

One of the following is expected:
 - hasStep
 - objects
 - property
 - propertyType
 - supportedFormFactors

Error indicated by:
 {http://soap.sforce.com/2006/04/metadata}
with code:

Screenshot of an error image

Additional information

Feel free to attach a screenshot.

VS Code Version:Version: 1.57.1 (user setup) Commit: 507ce72a4466fbb27b715c3722558bb15afa9f48 Date: 2021-06-17T13:28:07.755Z Electron: 12.0.7 Chrome: 89.0.4389.128 Node.js: 14.16.0 V8: 8.9.255.25-electron.0 OS: Windows_NT x64 6.2.9200

SFDX CLI Version:sfdx-cli/7.105.0 win32-x64 node-v14.17.0

OS and version: Windows 8

randi274 commented 3 years ago

I'm not able to reproduce the error, but I also don't get any nice autocomplete for the actionType. @smaddox-sf my thought is that we maybe need to update our lwc-language-server to make sure it's up to date with the latest release?

victorng8 commented 2 years ago

I'm also facing the same error as @rahulgawale .

LWC Deploy error 1

My workaround to this is disabling the "XML Language Support by Red Hat" extension so that the error won't stop me from deploying my LWC

RedHat version

Additional information

Version: 1.61.2 Commit: 6cba118ac49a1b88332f312a8f67186f7f3c1643 Date: 2021-10-19T15:49:28.381Z (5 days ago) Electron: 13.5.1 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin x64 20.6.0

Salesforce CLI version = v53.0.1

OS and version: macOS Big Sur Version 11.6(20G165)

uip-robot-zz commented 2 years ago

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

Yuki311 commented 2 years ago

@rahulgawaleと同じエラーに直面しています。

LWCデプロイエラー1

これに対する私の回避策は、「Red HatによるXML言語サポート」拡張機能を無効にして、エラーによってLWCのデプロイが妨げられないようにすることです。

RedHatバージョン

追加情報

バージョン:1.61.2 コミット:6cba118ac49a1b88332f312a8f67186f7f3c1643日付 :2021-10-19T15:49:28.381Z(5日前) Electron:13.5.1 Chrome:91.0.4472.164 Node.js:14.16.0 V8:9.1.269.39-electron。 0 OS:ダーウィンx64 20.6.0

SalesforceCLIバージョン= v53.0.1

OSとバージョン:macOS Big Surバージョン11.6(20G165)

Your comment helped me. I thank you from the bottom of my heart.

jeffb-sfdc commented 2 years ago

I wasn't able to reproduce this issue. @rahulgawale if you are still able to reproduce this, please re-open this ticket, and describe the steps you are taking to reproduce this issue.

developerVedant commented 2 years ago

I am still facing the issue.Any workaround?

rahulgawale commented 2 years ago

@jeffb-sfdc I still see the error but this time it is not preventing me from deploying the code to org, I am able to deploy the code. @developerVedant try deploying the component folder itself. or disable the XML extension, as mentioned by @Yuki311.

Monika-Nishad commented 2 years ago

hey @rahulgawale can you please tell the exact solution to this problem . i am trying to create a quick action in lwc but unable to deploy my component .what should i do ?

rahulgawale commented 2 years ago

@Monika-Nishad it didn't prevent me from deployment. Only error were showing on vs console

bolaurent commented 11 months ago

I have this error. It displays as a "Problem" when saving the lwc xml file in vscode, but it does not prevent deployment.

image

Version: 1.84.0 Commit: d037ac076cee195194f93ce6fe2bdfe2969cc82d Date: 2023-11-01T11:29:51.160Z Electron: 25.9.2 ElectronBuildId: 24603566 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Darwin arm64 23.0.0

The Salesforce CLI

VERSION @salesforce/cli/2.14.6 darwin-arm64 node-v18.15.0