Skip to content
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

json-enc fails with complex json #119

Open
florian-sun opened this issue Dec 6, 2024 · 0 comments
Open

json-enc fails with complex json #119

florian-sun opened this issue Dec 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@florian-sun
Copy link

If I set hx-vals to a JSON object containing an array, and the array is populated with more than one item, like this

<button hx-ext="json-enc" hx-vals='{"Id":1,"Items":["abc","xyz"]}'> ...</button>

I get an error when I do a POST request:

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Array'
--- index 2 closes the circle
at JSON.stringify ()
at Object.encodeParameters (json-enc.js:32:20)
...

@Telroshan Telroshan added the bug Something isn't working label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants