Not sure if this is bs-react-native issue or bucklescript core (or perhaps ReasonReact) issue; starting here first.
Three times today I ran through the "Getting Started" script from the README file.
Each time I ended up getting the following error in Expo after creating the basic app.re and editing, at step 7, ./App.js (in my case it's App.js that is created by create-react-native-app; the README instructions as written currently are to edit index.ios.js / index.android.js, which I don't think the vanilla create-react-native-app creates, but I digress) to use the Bucklescript generated app.js in /lib/js/re/app.js
.
The error after was
(in Expo): Unable to resolve module 'reason-react/lib/js/src/reasonReact.js' from '<...path to my app>/lib/js/re/app.js': Module does not exist in the module map
For a bit I thought this error might have something to do with issue #82 in part as I'm seeing Duplicated package: reason-react
in my builds.
That said, while looking through still more I noticed that the naming in ./node_modules/reason-react/lib/js/src/ReasonReact.js -- i.e., capital "R".
As context, here's what BuckleScript generated from re/app.re into the top of /lib/js/re/app.js:
var Curry = require("bs-platform/lib/js/curry.js");
var TextRe = require("bs-react-native/lib/js/src/components/textRe.js");
var StyleRe = require("bs-react-native/lib/js/src/styleRe.js");
var ReactNative = require("bs-react-native/lib/js/src/reactNative.js");
var ReasonReact = require("reason-react/lib/js/src/reasonReact.js");
I checked the other files referenced in these require statements and they are all named in the file system with their first letter as lower case (e.g., reactNative.js) - i.e., camel case.
Sure enough by either renaming the ReasonReact file itself to reasonReact.js ("ReasonReact.js" --> "reasonReact.js") or manually editing the Bucklescript generated require statements the opposite way, ("reasonReact.js" -> "ReasonReact.js"), it works -- my app displays and works correctly in Expo and I am off and running.
Any idea where this inconsistency of naming could be coming from? For now I'm just manually editing the generated file after each BS compile but that's a pain.
As context, I'm on node v8.9.1 (npm v5.5.1), though had same problem with node 6.11.4.
OCaml version is 4.02.3.
Bucklescript 2.1.0
I've included some photos including from my package.json.
Opening an issue as I did this 3x, very vanilla, no going off the reservation and right to the script on the README, and ended up in the same exact spot each time.
![top of app in Expo](https://user-images.githubusercontent.com/2136904/33236946-1da15e18-d232-11e7-95d3-6ea39fe08108.png)
![middle of app in Expo](https://user-images.githubusercontent.com/2136904/33236948-252459a6-d232-11e7-8dc7-e79c757802b2.png)
![ReasonReact.js file naming](https://user-images.githubusercontent.com/2136904/33236953-60eb611e-d232-11e7-9c7f-ff32578bd298.png)
![app.js generated from bucklescript](https://user-images.githubusercontent.com/2136904/33236955-6f2560cc-d232-11e7-86a6-9d6961de3854.png)
![dependencies in package.json](https://user-images.githubusercontent.com/2136904/33236967-8a24f784-d232-11e7-9f65-2f03567de544.png)