#4095·htmx

Issues with head extension defer behavior

Author: scrhartleyCreated Sep 23, 2026Updated Sep 24, 2026

I've noticed that since the deferred scripts functionality was added, it doesn't fire htmx:head:before:add for them, so the user has no capability to prevent those tags from being added.


The following has been evaluated and changing the behavior may have problematic consequences (see PR #4092). I'm recording it for posterity, but perhaps it can be ignored:

The defer detection doesn't detect module scripts properly. All modules are implicitly deferred, but this doesn't affect the defer JS property.

It reflects the defer attribute of the