Hello,
I’m updating some old code written with js_of_ocaml, and I have an error in the compilation with the latest library. This small part of the code does not compile anymore:
open Js_of_ocaml
type message = unit
type worker = (Js.js_string Js.t, message) Worker.worker Js.t
let () =
let (worker : worker) = Worker.create "" in
let handler : (_, (_, _) Dom_html.messageEvent Js.t) Dom_html.event_listener =
Dom.handler (fun (event : message Worker.messageEvent Js.t) -> Js._true)
in
worker##.onmessage := handler
The relevant part of the error message is this part:
Type
('c, 'd) Worker.worker Js.t Js.opt Js_of_ocaml__.Js.readonly_prop =
< get : ('c, 'd) Worker.worker Js.t Js.opt > Js.gen_prop
is not compatible with type
Dom_html.element Js.t Js.opt Js_of_ocaml__.Js.readonly_prop =
< get : Dom_html.element Js.t Js.opt > Js.gen_prop
…
The second object type has no method onerror
Is this something I have to update on my side?