Closed yennor closed 5 months ago
I am unable to reproduce this. Could you put a sample project somewhere that shows the issue? Or paste the code of a test here that shows the issue?
Since there has been no update, I am closing this issue. Feel free to re-open if you have more info, or even better a small reproducer.
I've just stumpled over the same issue again.
HtmxResponse.builder()
.trigger("showToast", "Die Einträge wurden erfolgreich gelöscht.")
This time I went a bit deeper. The problem is the spring boot config option which I use in the development profile:
spring:
jackson:
serialization:
indent-output: true
Since HtmxResponseHandlerMethodReturnValueHandler injects the default objectMapper to serialize the values to json, the json output will be formatted like that. Propably it would be better to create a own objectMapper to not depend on this or any other configuration changes the developper does to the default mapper.
Thanks for finding that! I hit the similar issue and with your input that explains the root cause perfectly
@yennor thanks for pointing us in the right direction. I have pushed a fix for it.
Released as 3.4.1
If you add multiple triggers to a HtmxResponse, like:
Spring will throw a IllegalArgumentException (Spring boot 3.1). As it seems a cr/lf is added instead of a coma to separate the different triggers:
edit: i've realised I was one version behind. Just changed the stracktrace.