When I try to add new tax rule I am getting "require is not defined" error in console which cause properly loading issue for Tax Rate, Customer Tax Class and Product Tax Class field (see below screenshot). Any idea why I am getting this error?
-
is this only on that page? Any other pages? Have you tried deleting cache and generated folders and then compile and deploy?– Kalvin KlienCommented Sep 16, 2021 at 7:04
-
Magento version number?– Kalvin KlienCommented Sep 16, 2021 at 7:05
-
@KalvinKlien That is the only page. Magento version in 2.4.1. I have other magento site with same version which working fine. Not sure what happened with this one.– Nayem323Commented Sep 16, 2021 at 7:36
2 Answers
This might not apply to you, but I experienced this issue and was able to resolve it by disabling a Cloudflare feature called Rocket Loader.
The 3 require errors you're seeing are part of the html sent to the browser, but not handled by Rocket Loader. As such they execute before require is available.
I haven't seen this cause any other issues anywhere in Magento so it's a strange one.
Turning off Rocket Loader on Cloudflare worked for me. I was having the same issue on 2.4.4.