-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught (in promise) Missing Target: #[object HTMLButtonElement] was not found in the current document. #64
Comments
Hi, so there's something a bit off with that rendered HTML:
|
I think i copy pasted the html from my browser incorrectly. The x-target is empty and not button. Sorry for the confusion. Here is the actual html <html lang="en" class=" dnvyzo idc0_350">
<head><meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script defer="" src="https://cdn.jsdelivr.net/npm/@imacrayon/alpine-ajax@0.5.0/dist/cdn.min.js"></script>
<script defer="" src="https://cdn.jsdelivr.net/npm/alpinejs@3.11.1/dist/cdn.min.js"></script>
</head>
<body>
<form id="like" x-init="" x-target="" method="post" action="/comments/1/like">
<button name="id" value="1">Like</button>
</form>
</body>
</html> Based on your answer i am assuming x-target="" should be x-target instead for it to target itself. But i'm not sure if a can configre my html render to not parse it like this |
Ah, I was able to track down the problem. It's some browser DOM weirdness and some unsafe programming on my part. Since your submit button is named I'll try to get a patch out really soon, but in the meantime if you change that button name to something like |
Amazing! You're so fast. Thank you very much. Quite a hilarious bug. Good thing you found it. |
Thank you for the thorough details! |
I want to try out Alpine-ajax, but I can't get it to work. I have installed it by including it in the head of my HTML file. All seems to work until I interact with the page, and I get an error:
Screenshot of the error:
I tried to reproduce the toggle example but this error has stumped me.
I am using Bun and Elysia for serving my code and i made a repository to reproduce this error:
https://github.com/hansaskov1/alpine-ajax-button
The entire source code is also here.
Here is the rendered html from the browser
Could someone please help me understand and resolve this issue?
The text was updated successfully, but these errors were encountered: