Incorrect JavaScript File Loading Order After Enabling CSP module #39274
Labels
Issue: ready for confirmation
Reported on 2.4.x
Indicates original Magento version for the Issue report.
I am encountering an issue with the loading order of JavaScript files (
require.js
,mixins.js
,requirejs-config.js
) after enabling Content Security Policy (CSP) in Magento 2. This appears to be breaking JavaScript bundling, causing improper execution order and related issues.Reproduction Steps:
require.js
,mixins.js
,requirejs-config.js
.Screenshots:
Before enabling CSP: Correct file order (Screenshot below)
After enabling CSP: Incorrect file loading order
Cause:
It seems that the issue is related to CSP configurations interfering with the loading order and possibly the integrity attribute (hash) of JavaScript assets, specifically in how property groups are handled within
GroupedCollection
.In this file, the integrity attributes (hash) should be ignored when grouping properties.
Proposed Workaround: (doesn't work properly broke integrity :( )
I suggest modifying the grouping logic to disregard the
integrity
attribute when comparing asset properties.Example workaround code:
Expected Outcome:
The text was updated successfully, but these errors were encountered: