I have an LWC embedded in a flow that has a custom footer. Whenever to click on the custom buttons to navigate the next screen, I get the following error:
Uncaught Action failed: flowruntime:flowRuntime$controller$handleNavigate [The 'NEXT' navigation option isn't supported on this screen. Replace it with one of the available navigation options: FINISH.]
Not sure how or why I am getting the error when the 'NEXT' option is in this.availableActions. The flow navigates to the next screen but I still get the error. The weirdest part is that it complains about the opposite if I try to use 'FINISH'.
Here is the snippet of the code:
let navigationEvent;
if (this.availableActions.find(action => action === "FINISH")) {
navigationEvent = new FlowNavigationFinishEvent();
} else if (this.availableActions.find(action => action === "NEXT")) {
navigationEvent = new FlowNavigationNextEvent();
}
try {
this.dispatchEvent(navigationEvent);
} catch (e) {
console.log(e);
}
<target>lightning__FlowScreen</target>
in meta xml?