woutdp / live_svelte

Svelte inside Phoenix LiveView with seamless end-to-end reactivity
https://hexdocs.pm/live_svelte
MIT License
1.01k stars 37 forks source link

Log `Jason.decode` errors #113

Closed acco closed 2 months ago

acco commented 4 months ago

Any particular reason to silently ignore Jason.decode errors here?

https://github.com/woutdp/live_svelte/blob/master/lib/component.ex#L129

This results in the downstream error of <MyComponent was created without expected prop 'my_prop'>, which hides the core issue (that the prop you passed in was not Jason decodable).

Unless I'm missing something, two options:

What do you think? 🙏

woutdp commented 4 months ago

Not sure why I ignored it, been a while since I looked at that code.

Any of the 2 proposed solutions would be fine with me. Feel free to create a PR.

acco commented 4 months ago

Thanks! I figured a raise was most explicit, couldn't think of a good reason to fail quietly

https://github.com/woutdp/live_svelte/pull/114

woutdp commented 2 months ago

Fixed in: https://github.com/woutdp/live_svelte/pull/114