-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
@-directive: Uncaught (in promise) DOMException: String contains an invalid character (Livewire.js:13) #1235
Comments
@Yinci It's the default behaviour in Laravel. The '@' symbol has a specific meaning in blade files (You would get the same error with other frameworks): |
That makes sense, but it also doesn't. How come it works 95% of the time, just not in this use case? |
Do you have an example where it works in blade without escaping the @. |
I've been using |
🤷♂️ The laravel documentation says to escape the @ symbol so I would follow it. I personally don't use that stack but other laravel devs should be able to tell you why some times it works and some times it doesn't. |
That's fair enough! Makes sense, I just can't wrap my head around why it then would work in the first sense.
Anyhow, I suppose I'll close this as it's not really an issue, but perhaps it could be mentioned in the readme. |
Re-opening this. I've been escaping Simply put: Refreshing a table that contains an |
Yeah, turns out element.setAttribute doesn't allow @ symbols. So any time morphdom tries to set a new @on attribute for any reason, the browser throws this error. It's a pity because those attributes are perfectly fine in HTML when the element is created. Will need to explore alternatives to .setAttribute if there are any |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I am not entirely sure if this is more relevant to Alpine or to Livewire, but since the issue comes from Alpine I'll post it here;
For context: I have a table that displays users, and users can be softdeleted. On each user row, there are buttons to either delete or restore that user. See the code below:
Upon either deleting or restoring the user, the error
Uncaught (in promise) DOMException: String contains an invalid character
is triggered at line 13 in Livewire.js according to the console. This breaks the whole page.When changing
@
tox-on:
there is no issue.Versions:
Firefox: 87.0 (64 bits)
Laravel: 8.21.0
Livewire: 2.3.0
AlpineJS: 2.8.2
The text was updated successfully, but these errors were encountered: