The issue had nothing to do with using htmx incorrectly, I'm posting this as an answer in case someone has this bizzare issue as well.
There were 4 scripts sourced in the layout, among them htmx.js... Additionally, there was a small script sourced in the view from which the form is submitted. I use that to toggle a modal: <script src=~/js/modal.js" />
.
Get this: This script prevented htmx.js (but not any of the other scripts) from loading. The fix? Changed it to <script src=~/js/modal.js"></script>
Since self-closing script tags are not allowed in html, everything up to the </script>
of the htmx script was ignored. Somehow the modal.js
script was completely intact and a bunch of missing closing tags for various divs and main
were not an issue.