I have created this boilerplate using bsb -init -theme react-hooks
and then I have removed the react-related code.
npm install
npm run server
# in a new tab
npm start
Open a new web page to http://localhost:8000/.
If running in a browser there is an uncaught Failure
exception.
In index.bs.js there is a comparison:
exn[0] === Caml_builtin_exceptions.failure
Both exn[0]
and Caml_builtin_exceptions.failure
are ["Failure", -2, tag: 248]
,
but the comparison of these doesn't return true
.
console.log(exn[0]) // ["Failure", -2, tag: 248]
console.log(Caml_builtin_exceptions.failure) // ["Failure", -2, tag: 248]
console.log(exn[0] === Caml_builtin_exceptions.failure) // false
There is no problem with running from command line:
node src/index.bs.js