Turbo: JS aggregation causes the RefreshLess JavaScript to evaluate more and more times on navigation

Created on 13 January 2024, 10 months ago

Problem/Motivation

This has only been tested on Drupal 10.1+ with its improved aggregation system, so it may be something to do with how Turbo handles query strings when deciding if a JS file is already referenced in the <head> or if it should be inserted and evaluated anew.

Steps to reproduce

Enable JavaScript aggregation. Navigate around and start seeing the console debug messages multiply, along with various errors when behaviours are double, triple, etc. attached:

RefreshLess: redirected /wiki/Special:Random → /wiki/2049/10/03/Adira js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1859:2492
RefreshLess: redirected /wiki/Special:Random → /wiki/2049/10/03/Adira js_91B8e_fr_qMZjN308me2y5aKFcx82T_6cWN5klDnuFc.js:1859:2492
RefreshLess: redirected /wiki/Special:Random → /wiki/2049/10/03/Adira js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1859:2492
RefreshLess: detaching behaviours js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1861:1450
RefreshLess: detaching behaviours js_91B8e_fr_qMZjN308me2y5aKFcx82T_6cWN5klDnuFc.js:1861:1450
RefreshLess: detaching behaviours js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1861:1450
RefreshLess: detaching behaviours js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1861:1450
RefreshLess: drupalSettings has been updated js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1859:631
RefreshLess: drupalSettings has been updated js_91B8e_fr_qMZjN308me2y5aKFcx82T_6cWN5klDnuFc.js:1859:631
RefreshLess: drupalSettings has been updated js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1859:631
RefreshLess: attaching behaviours js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1861:1286
RefreshLess: detaching behaviours js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1861:1450
RefreshLess: attaching behaviours js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1861:1286
RefreshLess: attaching behaviours js_hhgE22TbJoFEc0p2gGcm5NrkLElXp2JKD5t-ppI6IeU.js:1861:1286
RefreshLess: attaching behaviours js_91B8e_fr_qMZjN308me2y5aKFcx82T_6cWN5klDnuFc.js:1861:1286
RefreshLess: attaching behaviours

Proposed resolution

Unsure. Figure out if it's on our end or if it's a Turbo issue. If the latter, work around it if possible, or not, open an issue on their GitHub.

Remaining tasks

See above.

User interface changes

Stuff less borked.

API changes

None?

Data model changes

None.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada ambient.impact Toronto

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024