Skip to content

Instantly share code, notes, and snippets.

@philzook58
Last active January 1, 2022 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philzook58/584c64a6a1fdde6db3c984e8947114cb to your computer and use it in GitHub Desktop.
Save philzook58/584c64a6a1fdde6db3c984e8947114cb to your computer and use it in GitHub Desktop.
js_of_ocaml custom directory
dune build main.bc.js --release
node _build/default/main.bc.js

Returns

$node _build/default/main.bc.js
/home/philip/Documents/ocaml/bapjs2/jsoo_crash/_build/default/main.bc.js:3937
       {r += exn[1][1];
                   ^

TypeError: Cannot read property '1' of undefined
    at caml_format_exception (/home/philip/Documents/ocaml/bapjs2/jsoo_crash/_build/default/main.bc.js:3937:20)
    at caml_fatal_uncaught_exception (/home/philip/Documents/ocaml/bapjs2/jsoo_crash/_build/default/main.bc.js:3976:16)
    at process.<anonymous> (/home/philip/Documents/ocaml/bapjs2/jsoo_crash/_build/default/main.bc.js:5753:12)
    at process.emit (events.js:314:20)
    at process._fatalException (internal/process/execution.js:165:25)
(executable
(name main)
(modes byte js)
(js_of_ocaml (flags --pretty
--file /home/philip/Documents/ocaml/bapjs2/jsoo_crash/mytest.txt:/custom-folder/
))
)
let () = Array.iter (fun d -> print_endline d) (Sys.readdir "/static/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment