I'm working on a D9 website. On my local server I have all caching and performance settings like js and css aggregation turned off. Now when I copy my site to me remote server these settings are on. Good to know is that I use advagg
next to the core performance options.
But on some of the pages in the back-end of the website I get js errors resulting in problems with, for example, admin_toolbar
and field_groups
modules.
The errors I get are:
js_nQSC-j3xSBBFH94RLP2UNldFGFjdcQr_cdv6pqavR50.js:
263 Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
js_XMjKep3b2Hxz8NdcZwBLPiZQ2m6qy98seMywBj9lZZ8.js:
475 Uncaught TypeError: Cannot read properties of undefined (reading 'attach')
js_XMjKep3b2Hxz8NdcZwBLPiZQ2m6qy98seMywBj9lZZ8.js:56
Uncaught TypeError: Drupal.toolbar.ToolbarModel is not a constructor
When looking at the log messages there are no messages related to my issues.
When I disable the core JS and CSS aggregation in the Performance page of the site the problems disappear and all is working look they should. After I did this new message appear in the message log. These messages point to missing js.map files. I don't know if this has something to do with my problem. So I add them below.
/sites/default/files/js/optimized/maps/script.min.js.map
/sites/default/files/js/optimized/html5sortable.min.js.map
/sites/default/files/js/optimized/index.umd.min.js.map
/sites/default/files/js/optimized/jquery.once.min.js.map
/sites/default/files/js/optimized/backbone-min.map
I also tried to disable advagg and use just the core js and css aggregation but this dit solve the problem. So it looks like there is a problem with the core functionality. And this is as far as my research went, and I'm stuck now. Can someone help me with the next step in finding out what is the problem?