bigskysoftware / bigskysoftware/htmx
hx-sync has cryptic `elt is null` errors on malformed values
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
### The error
In Firefox v124:
```
Uncaught TypeError: elt is null
getInternalData https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:715
issueAjaxRequest https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:4068
processVerbs https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2525
delayed https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2428
setTimeout handler*eventListener https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2428
addEventListener https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2443
forEach https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:746
addEventListener https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2366
addTriggerHandler https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2577
processVerbs https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2519
processVerbs https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2518
forEach https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:746
processVerbs https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2512
initNode https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2766
processNode https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2804
forEach https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:746
processNode https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:2804
https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:4875
ready https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:4838
htmx https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:4871
https://unpkg.com/htmx.org@2.0.0-beta1/dist/htmx.js:4911
```
In Chromium v123:
```
htmx.js:715 Uncaught TypeError: Cannot read properties of null (reading 'htmx-internal-data')
at getInternalData (htmx.js:715:19)
at issueAjaxRequest (htmx.js:4068:17)
at htmx.js:2525:13
at htmx.js:2428:71
```
### To Reproduce
```
```
Type anything into the input, wait 500ms, and you'll see the error.
Ideally the error would helpfully point you to the invalid `hx-sync` value that needs to change.
Contributor guide
Assessment
This issue has not been assessed yet.