Skip to content

[BUG] graphics bindings (open_canvas) work only when built with "dune build --release" #1029

Closed
@adept

Description

@adept

Describe the bug

  1. Clone the project https://github.com/adept/ocaml-canvas-test

  2. Build it with dune build canvas.bc.js

  3. Run it with index.html supplied

  4. Observe runtime error

     canvas.bc.js:164237 Uncaught ReferenceError: caml_gr_state_create is not defined
     at open_canvas (canvas.bc.js:164237)
     at caml_call1 (canvas.bc.js:164415)
     at onload (canvas.bc.js:164438)
     at caml_call1 (canvas.bc.js:152942)
     at canvas.bc.js:154769

Indeed, there is no caml_gr_state_create in scope (but there is jsoo_runtime.caml_gr_state_create)

  1. Build the project with "dune build --release canvas.bc.js"

  2. Observe that it is working now.

Expected behavior
Non-release build should work as well

Versions

  • ocamlc 4.09.1
  • js_of_ocaml 3.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions