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

Unable to start Bonsai #21

Open
duggi28 opened this issue May 4, 2022 · 8 comments
Open

Unable to start Bonsai #21

duggi28 opened this issue May 4, 2022 · 8 comments
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.

Comments

@duggi28
Copy link

duggi28 commented May 4, 2022

I was struggling to start Bonsai and run some of the examples. After running dune build, I get the following error message:

File "examples/counters/bin/dune", line 1, characters 48-75:
1 | (executables (names main) (libraries bonsai_web bonsai_web_counters_example)
                                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "bonsai_web_counters_example" not found.
-> required by _build/default/examples/counters/bin/main.exe
-> required by alias examples/counters/bin/all
-> required by alias examples/counters/bin/default
@github-iron github-iron added the forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system. label May 4, 2022
@TyOverby
Copy link
Member

TyOverby commented May 4, 2022

are you able to build other examples, like hello_world?

@duggi28
Copy link
Author

duggi28 commented May 6, 2022

I was not able to build hello_world either as I got the following error:

File "examples/hello_world/dune", line 1, characters 37-47:
1 | (executables (names main) (libraries bonsai_web) (preprocess (pps ppx_jane)))
                                                                   ^^^^^^^^^
Error: Library "bonsai_web" not found.
-> required by _build/default/examples/hello_world/main.exe
-> required by alias examples/hello_world/all
-> required by alias examples/hello_world/default

I am a student who recently finished creating a blog-like application in OCaml which only works on terminal. I wanted to create a UI using Bonsai.

@TyOverby
Copy link
Member

TyOverby commented May 7, 2022

I would recommend copying the hello-world folder into a new opam-switch and installing bonsai from opam instead of trying to use it from the github clone

@duggi28
Copy link
Author

duggi28 commented May 25, 2022

I installed bonsai from opam in a new opam switch but I still received the same error message as above. I even copied the hello_world folder into a different directory.

@askvortsov1
Copy link
Contributor

If using bonsai installed from opam, make sure you use the public_name value for dune libraries stanzas. For bonsai_web, this would be bonsai.web.

@duggi28
Copy link
Author

duggi28 commented May 25, 2022

Changing the library name to bonsai.web fixed the error. However, I am still seeing errors related to the Result_spec module. The first error is that Start.Result_spec is an unbound module. The second error is related to the lack of labels for the arguments of the start function:

File "main.ml", line 7, characters 77-86:
7 |   Start.start Start.Result_spec.just_the_view ~bind_to_element_with_id:"app" component
                                                                                 ^^^^^^^^^
Error: The function applied to this argument has type
         initial_input:'a -> ('a, 'b, 'c, 'd) Bonsai_web__Start.Handle.t
This argument cannot be applied without label

@TyOverby
Copy link
Member

That api looks like it has the type signature from a very old version of Bonsai, could you check to see what version you have installed via opam

@duggi28
Copy link
Author

duggi28 commented May 25, 2022

I have version 0.14.0 and was trying to upgrade to v0.15.0. However, I kept running into the following error:

#=== ERROR while compiling conf-libssl.4 ======================================#
# context     2.1.2 | macos/x86_64 | ocaml-base-compiler.4.12.0 | https://opam.ocaml.org#9a5d6274
# path        ~/.opam/bonsai-2022sp/.opam-switch/build/conf-libssl.4
# command     ~/.opam/opam-init/hooks/sandbox.sh build sh -ex ./homebrew.sh check
# exit-code   1
# env-file    ~/.opam/log/conf-libssl-43714-3e7dfe.env
# output-file ~/.opam/log/conf-libssl-43714-3e7dfe.out
### output ###
# ++ brew --prefix openssl
# + brew_pkg_config=/usr/local/opt/openssl@3/lib/pkgconfig
# + case "$1" in
# + test 1 '!=' 1
# + export PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig:/Users/rithvikduggireddy/.opam/bonsai-2022sp/lib/pkgconfig:
# + PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig:/Users/rithvikduggireddy/.opam/bonsai-2022sp/lib/pkgconfig:
# + pkg-config --print-errors --exists openssl
# Package openssl was not found in the pkg-config search path.
# Perhaps you should add the directory containing `openssl.pc'
# to the PKG_CONFIG_PATH environment variable
# No package 'openssl' found



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
┌─ The following actions failed
│ λ build conf-libssl 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.
Projects
None yet
Development

No branches or pull requests

4 participants