Open johnwhitington opened 2 years ago
It is expected and due to https://github.com/ocsigen/js_of_ocaml/blob/d7117ff551015fc27b583fe67f54a61c2950354f/runtime/sys.js#L338. Maybe we should only have that logic turned on for standalone programs.
Thanks for the explanation. Yes, it would be a useful option.
I'm very new to JavaScript, so I don't know how common it is to use the REPL, or whether libraries commonly have non-modular effects like this.
Consider a blank
a.ml
Now, in node, an error normally allows us to resume, putting us back at the prompt:
But after requiring our new
a.js
operation, an error completely unrelated to thejs_of_ocaml
code causes the whole node process to exit:Is this expected? I should say this also happens with my real project, which has an
exports.ml
like this:I understood that would make it usable from node via
require
. It is usable, but it has this odd error behaviour.I'm using
js_of_ocaml
4.0.0 and node 18.0.0.