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.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
victorng8commented, Oct 25, 2021

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)

1reaction
randi274commented, Jul 20, 2021

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quick Action as LWC 2021 - Salesforce Stack Exchange
Invalid element name : actionType. One of the following is expected: hasStep; objects; property; propertyType; supportedFormFactors. Error ...
Read more >
Error - Invalid target lightning__RecordAction in Sumer 21 Org.
Hello, I was trying to test invoking lwc using Quick action. But, while pushing source code from VS code is giving error:
Read more >
Lightning Components - Sara Has No Limits
Posts about Lightning Components written by Sara Morgan. ... This is done by using a meta configuration file for LWC's or a design...
Read more >
5 Common Errors in Lightning Web Component
Do you love writing Lightning Web Components in Salesforce? ... You might be using masterLabel attribute in meta-xml with a different name ...
Read more >
Use Lightning Web Components for Quick Action
We have used Action in attribute. Once saved we cannot change the actionType of LWC. If we try to change it we will...
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