Issue with defer a minified file

Created on 3 July 2024, 6 months ago

We updated Drupal core to 10.3.0 on a website recently, and when aggregation was enabled, we started getting an issue around minification.

This, on its own, was easily resolved by telling the libraries.yml file that the .min.js file is minified, so it can handle it correctly. I will attach a patch to add this in once this ticket is created and I have the ID.

-----

Upon fixing this though, we came across a second issue, which was hard to diagnose, and so have had to do a workaround.

TypeError: Cannot read properties of undefined (reading 'get')

The workaround is to remove the `defer` flag in libraries. This implies a race condition somewhere, but only the minified js was in the repo I think, so was a little hard to debug.

I will attach a patchfile with this workaround too, not to be merged in, but to help others if needed.

πŸ› Bug report
Status

Active

Version

1.24

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom retrodans

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024