#my lustre message isnt working
1 messages · Page 1 of 1 (latest)
ok I will believe you for a second
unfortunately I can't figure out how to run your app so here's what you can do:
add a console.log inside build/dev/javascript/lustre/lustre/runtime/client/runtime.ffi.mjs on line 87:
const dispatch = (event, data) => {
const [events, result] = Events.dispatch(this.#events, data);
this.#events = events;
+ console.log(result);
if (result.isOk()) {
then restart dev-tools. what does it print for that event?
what's misleading ^.^
because it it cant decode why is it still giving me a result that looks correct
it fills the values out with zero values
that's what we meant when we said the decoder always runs fully
there is no early out and you will get a result even though there were errors along the way
and it makes for terrific debugging (terrible)
there's this thing that hayleigh came up with where you call decode.run yourself so you can look at the error:
event.on("whatever", {
let decoder = {
use wibble <- decode.field("...", ...)
...
}
use event <- decode.then(decode.dynamic)
let assert Ok(result) = decode.run(event, decoder)
decode.success(SomethingHappened(result))
})