There's a discrepancy between jsoo whole program compilation and separate compilation. You need to add a compile of std_exit.cmo at the end of the link phase, see this issue in js_of_ocaml.
> echo 'let () = print_string {|bla|}' > main.ml
> echo '(executable (name main) (modes js))' > dune
> dune build --profile=release ./main.bc.js
> node _build/default/main.bc.js
bla
> dune build --profile=dev ./main.bc.js
> node _build/default/main.bc.js
>
Versions:
> js_of_ocaml --version
3.6.0
> dune --version
2.5.1