Maybe you would know why after advanced bundling product gallery script is not executed?
It might be solved in another way (simple and stupid). Both Magento and Requirejs text.js files might be merged into one, but split by
if (typeof window === 'undefined')
So on backend side correct Requirejs file will do the magic, while there will be Magento file executed on frontend
I have fixed this problem by replacing in my build.js paths section following line
'text': 'mage/requirejs/text'
to
"text": "requirejs/text"
Thanks.
This solution works for me (magento version is 2.4.4-p2).
I also got the same error.
And follow your guide to fix it.
Hi @klaas_werkt,
The error "ReferenceError: XMLHttpRequest is not defined" typically indicates that the code is attempting to use XMLHttpRequest in a context where it is not available. In the context of a Node.js environment or during the optimization process with r.js (RequireJS), XMLHttpRequest is not available because it is a browser-specific object.
To resolve this issue, consider the following:
(typeof XMLHttpRequest !== 'undefined') { /* browser-specific code */ }.
Here is an example of how you might conditionally check for XMLHttpRequest in your code:
if (typeof XMLHttpRequest !== 'undefined') { // Browser-specific XMLHttpRequest code } else { // Node.js-specific code using http/https modules }