Turbo: Visiting pages with 4xx response codes causes re-evaluation of <head> JavaScript

Created on 21 February 2024, 9 months ago
Updated 25 February 2024, 9 months ago

Problem/Motivation

See next heading. Actually, it's entirely a Turbo issue where they hard code completely re-evaluating all scripts if the response was non-successful, i.e. a 4xx or 5xx error; see comments in hotwired/turbo#1190

Steps to reproduce

Visit a 404 or 403 or other 4xx page; note console debug messages are logged an additional time after a page or two after the 4xx page, resulting in 2, 3, 4, and so on instances of the same message, and depending on the other JavaScript and how it's handling behaviours, will probably start to result in errors.

Proposed resolution

This is something that Turbo hard codes (see hotwired/turbo#1190) so we'll have to patch Turbo ourselves in the short term, and contribute a fix in the longer term.

Remaining tasks

See above.

User interface changes

Stuff no longer borked.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Postponed

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

Comments & Activities

Production build 0.71.5 2024