Add button to webform header is not working

In previous version “13” add_button_to_header was working but now we have switched to version 14 and it is not working. Please find here the full code.

frappe.web_form.after_load = () => {
frappe.web_form.add_button_to_header(“test”, “submit”, ()=>{alert(‘Hello World’)})
}

This code is throwing following error: