[htmx4] HTMX errors if HX-Trigger Event Detail is null
Maintainers usually reply within 4 days
@MichaelWest22 is already working on this.
Since Oct 15, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start by reading the trigger method shown in the issue and the documentation for the HX-Trigger response header. Check the tests covering trigger event details, then reproduce a response with no detail object. Done when that response no longer causes an error and the existing event behavior still passes its tests.
Written by the indexing model from the issue text.
Description
If the server returns a HX-Trigger header response with no Detail object then htmx fails here
trigger(on, eventName, detail = {}, bubbles = true) {
on = this.#normalizeElement(on)
let evt = new CustomEvent(eventName, {
detail,
cancelable: true,
bubbles,
composed: true
});
let target = on?.isConnected ? on : document;
let result = !detail.cancelled && target.dispatchEvent(evt); <--- Error here
return result
}
with a htmx:error: can't access property "cancelled", detail is null
The documentation suggests that the detail object is optional so I think the line needs a guard statement?
- Dominant language
- JavaScript
- Stars
- 49.6k
- Forks
- 1.7k
- Avg merge
- 9d 3h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bigskysoftware/htmx
-
Only the first `from:body target:` trigger fires when there are two on htmx 2Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bigskysoftware/htmx#4155 ·
Maintainers usually reply within 4 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
bigskysoftware/htmx#4151 · 1 comment ·
Maintainers usually reply within 4 days
-
[htmx4] Swap style for boosted elements is not outerSyncPossibly taken @1cg claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bigskysoftware/htmx#4138 · 3 comments · 1 assignee ·
Maintainers usually reply within 4 days
-
[htmx4] When importing and configuring htmx with JS, you can't turn off indicator CSSPossibly taken @MichaelWest22 claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bigskysoftware/htmx#4122 · 1 comment · 1 assignee ·
Maintainers usually reply within 4 days
-
No GitHub Release for version 2.0.11Possibly taken @1cg claimed this 8 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 75/100
bigskysoftware/htmx#4117 · 1 assignee ·
Maintainers usually reply within 4 days
All issues in bigskysoftware/htmx
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
melodic-software/claude-code-plugins#9619 ·
Maintainers usually reply within 1 day
-
bug Frontend P2-medium UI UX
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Deepak3699/Ai_Mentor#427 ·
Maintainers usually reply within 1 day
-
area: core
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
venn: a name that starts with set-, union-, text- or style- followed by a letter is a parse errorOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
obsidianmd/pele#65 ·
Maintainers usually reply within 3 days
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
11ty/buildawesome#4407 · 1 reaction ·
Maintainers usually reply within 1 day