You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ReorderHead transformer uses the URL as an array key when collecting <script> elements to reorder. This means that if multiple <script> elements use the same URL (like for .mjs script + nomodule fallback), they overwrite each other in the array and are effectively "deduplicated".
The ReorderHead transformer needs a more robust algorithm. It seems that deduplication is still desirable, but will need to rely on "URL + a selection of attributes". The exact selection needs to be clarified, but for now it might help to hash the URL + the presence of nomodule as a first bug fix.
The text was updated successfully, but these errors were encountered:
This means that if multiple <script> elements use the same URL (like for .mjs script + nomodule fallback), they overwrite each other in the array and are effectively "deduplicated".
How would they use the same URL? The module scripts end in .mjs and the nomodule ones end in .js. The problem seems to rather be the reliance on the custom-element and custom-template attributes. Switching this to use src as per ampproject/amp-toolbox#1192 seems to do it.
The
ReorderHead
transformer uses the URL as an array key when collecting<script>
elements to reorder. This means that if multiple<script>
elements use the same URL (like for.mjs
script +nomodule
fallback), they overwrite each other in the array and are effectively "deduplicated".The
ReorderHead
transformer needs a more robust algorithm. It seems that deduplication is still desirable, but will need to rely on "URL + a selection of attributes". The exact selection needs to be clarified, but for now it might help to hash the URL + the presence ofnomodule
as a first bug fix.The text was updated successfully, but these errors were encountered: