[LWC QUICK ACTION]t.Invoke Is Not A Function – Solved

If you used lightning-quick action in LWC, then you might faced [LWC QUICK ACTION]t.Invoke Is Not A Function exception. Even when I was building a component same issue I have faced. In this blog let’s understand what is the solution for this exception.

lightning web components – LWC quick action not working

To fix the [LWC QUICK ACTION]t.Invoke Is Not A Function exception in LWC, check which action you are using in Quick action.

If you were using, the below two actions in your LWC component then check the meta XML file.

Also Read: How to use lightning/uiRecordApi In LWC

  1. ScreeAction

If you were using ScreenAction make sure this is added in the XML file.

<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
  <apiVersion>59.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__RecordAction</target>
  </targets>
  <targetConfigs>
    <targetConfig targets="lightning__RecordAction">
      <actionType>ScreenAction</actionType>
    </targetConfig>
  </targetConfigs>
</LightningComponentBundle>
  1. Action [headless action]

If you were using headless action then make sure the action type as action is configured in the meta XML file.

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle
	xmlns="http://soap.sforce.com/2006/04/metadata">
	<apiVersion>59.0</apiVersion>
	<isExposed>true</isExposed>
	<targets>
		<target>lightning__RecordAction</target>
	</targets>
	<targetConfigs>
		<targetConfig targets="lightning__RecordAction">
			<actionType>Action</actionType>
		</targetConfig>
	</targetConfigs>
</LightningComponentBundle>

If Still not solved – Then try this.

In this case, it will be a refresh or cookies issue. Also, If you were both XML files matched according to your quick action then check once in the Quick Action action type at the object level for the safer side.

Subtype as Action for Headless and SubType as ScreenAction for screen quick action.

LWC Quick action

If it is the same, then do multiple refreshes, clear cookies, and cache, log out from the sandbox. [You can also enable debug mode for LWC to clear the cache].

Login to sandbox after 5 minutes. This may solve your exception issue.

Conclusion

Always check the meta XML file matches with the action type being configured. If everything is matching clear the cookies, and cache then log out from the system. And try after some time.

Let me know in the comment section what change made you solve this exception.

Leave a Comment