Closed Norlock closed 3 weeks ago
In the (main) bundled mjs file a function to the ffi will add the following code: (void 0())
(void 0())
code in gleam:
@external(javascript, "./ffi.mjs", "drawLines") pub fn draw_lines() -> Nil { Nil }
excerpt main mjs file:
function modify_view(model) { let try_node_view = (node_idx, row_pos) => { return unwrap2(node_view(model, node_idx, row_pos), none3()); }; let left_row = (() => { let _pipe = model.nodes_left_row; let _pipe$1 = map2( _pipe, (idx) => { return try_node_view(idx, new Left()); } ); return node_views_into_rows(_pipe$1, new Left()); })(); let center_row = (() => { let _pipe = toList([try_node_view(model.active_node, new Center())]); return node_views_into_rows(_pipe, new Center()); })(); let right_row = (() => { let _pipe = model.nodes_right_row; let _pipe$1 = map2( _pipe, (idx) => { return try_node_view(idx, new Right()); } ); return node_views_into_rows(_pipe$1, new Right()); })(); (void 0)(); log("some ffi log"); return div( toList([class$("write-overview")]), toList([ svg(toList([id("lines-svg")]), toList([])), left_row, center_row, right_row ]) ); }
When I move the exact same code from ffi.gleam to js.gleam it works again. The log function does work.
ffi.gleam
js.gleam
Version: gleam 1.5.0
Lustre version:
[dependencies] gleam_stdlib = ">= 0.34.0 and < 2.0.0" lustre_http = ">= 0.5.2 and < 1.0.0" lustre = ">= 4.5.0 and < 5.0.0"
Sorry i’m going to need some more to go on than that, what is the gleam code?
Closing this for now, feel free to re-open if you can provide some more details!
In the (main) bundled mjs file a function to the ffi will add the following code:
(void 0())
code in gleam:
excerpt main mjs file:
When I move the exact same code from
ffi.gleam
tojs.gleam
it works again. The log function does work.Info:
Version: gleam 1.5.0
Lustre version: