I am trying the new summer 21 feature: LWC from quick action. I am trying this on my developer edition, already updated to summer 21 version.

But with a very simple code, the modal is not opening and I get and error that I don't understand.


   Test quick action


import { LightningElement, api } from 'lwc';
export default class TestQuickAction extends LightningElement {

    @api recordId;

    connectedCallback() {
        console.log("recordId", this.recordId);


<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="urn:metadata.tooling.soap.sforce.com" fqn="testQuickAction">
        <targetConfig targets="lightning__RecordAction">

Console Error:

[LWC QUICK ACTION]s.invoke is not a function
handleClick @   executorLwcHeadless.js:1

Any Idea?

1 Answer 1


If you want to create the screen action then use action type as ScreenAction. Action can be used only for headless actions. For headless action, you need to define the @api invoke(){...} function in your component.

Just change the action type inside the target config from your component's meta XML.

  • 3
    FYI - When i tried this it says "Cannot change the type of the existing Lightning Web Component action."
    – CodeMonger
    Jun 29, 2021 at 18:59
  • @CodeMonger did you try removing the references of the components? Jun 30, 2021 at 6:17
  • 3
    @CodeMonger I have it too. Deletion of component and re-creation worked
    – kurunve
    Nov 28, 2021 at 18:40
  • 3
    Had to delete from org and redeploy from vscode.
    – Venkata
    Apr 26, 2022 at 4:31

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.