How to use rtop in an esy project repl?


You can also answer this question in stackoverflow:

I am attempting to use rtop as repl on an esy project.

In order to do so, I have added "@esy-ocaml/rtop":"*" to the devDependencies section of my package.json file, and tried to start rtop with esy rtop:

  "dependencies": {
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "reason-react": ">=0.4.0"
  "devDependencies": {
    "bs-platform": "^4.0.14",
    "html-webpack-plugin": "^3.2.0",
    "webpack": "^4.0.1",
    "webpack-cli": "^3.1.1",
    "webpack-dev-server": "^3.1.8",

however, I am unable to load my components:

→ esy rtop
Reason # #use "./src/";
File "./src/", line 2, characters 5-16:
Error: Unbound module ReasonReact

Reason # #require "reason-react";
No such package: reason-react

Reason # #require "react";

Reason #

but, as you can see I am able to load React, whatever that means…

Well, how can I use rtop as my project repl?


Esy doesn’t magically make bs-platform works with native toolings.

rtop is exclusively for native only and can’t be use in a bucklescript project