Web form client scripts v11 not work (console error)

Hiii…
I added client script as below to web form v 11 as per the following link guide, but the scripts not work with me. even I reloaded page and cleared cache too.
https://frappe.io/docs/user/en/guides/portal-development/web-forms

client script

// Set Field Property based on value
frappe.web_form.on(‘business_registration_type’, (field, value) => {
if (value == ‘Domestic’) {
frappe.web_form.set_field_property(‘telephone_number’, ‘reqd’, 1);
}
else if (value == ‘Foreign’) {
frappe.web_form.set_field_property(‘telephone_number’, ‘reqd’, 0);
}
});

console error

Uncaught TypeError: Cannot read property ‘fields_dict’ of undefined
at frappe.web_form.wrapper.get_field (web_form_class.js:99)
at frappe.web_form.wrapper.on (web_form_class.js:129)
at Object.frappe.init_client_script (supplier-registration-application?new=1:390)
at web_form.js:40

And this

Please advise…

Hi
dufani1,

i am facing same issue can u please help me to solve this issue ??
In my case i am creating a sales order through website user only having role customer but while i am creating new sales order then item not display for normal user i have written one custom script and it will work fine there but for website user not able to fetch the item based on customer and company can u please help me
Thanks

is there any update on this?