Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with doc page "Export OCaml code to JavaScript" #960

Closed
bguil opened this issue Feb 2, 2020 · 1 comment
Closed

Problems with doc page "Export OCaml code to JavaScript" #960

bguil opened this issue Feb 2, 2020 · 1 comment

Comments

@bguil
Copy link

bguil commented Feb 2, 2020

On the documentation page Export OCaml code to JavaScript, I had to modify the example to let it work.

In the caml code:

Js.export "myMathLib" --> Js_of_ocaml.Js.export "myMathLib"
without this, I have the error Error: Unbound module Js

In the JS code:

math.add(2,3) --> math.myMathLib.add(2,3)
without this, I have the error TypeError: math.add is not a function

@hhugo
Copy link
Member

hhugo commented Dec 22, 2021

The ocaml side has been fixed in 43ded38

For the js side, I suspect you've mixed the two example. At least, I'm not able to reproduce your issue.

@hhugo hhugo closed this as completed Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants