reasonml / reason-react

Reason bindings for ReactJS

Home Page:https://reasonml.github.io/reason-react/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run initial project from docs

captain-yossarian opened this issue · comments

Hi, I'am unable to run initial project from docs.
This is the error:

D:\reasonml\gol\my-react-app>npm run start

> my-react-app@0.1.0 start D:\reasonml\gol\my-react-app
> bsb -make-world -w -ws _

ninja: error: 'D:/reasonml/gol/my-react-app/node_modules/reason-react/src/React.re', needed by 'src/React.reast', missing and no known rule to make it
Failure: D:\reasonml\gol\my-react-app\node_modules\bs-platform\win32\ninja.exe
 Location: D:\reasonml\gol\my-react-app\node_modules\reason-react\lib\bs
>>>> Start compiling
bsb: [1/6] src/ReasonUsingJSUsingReason/ReasonReactCard-MyReactApp.cmj
FAILED: src/ReasonUsingJSUsingReason/ReasonReactCard-MyReactApp.cmj

  We've found a bug for you!
  D:\reasonml\gol\my-react-app\src\ReasonUsingJSUsingReason\ReasonReactCard.re:9:3-6

   7 │ [@react.component]
   8 │ let make = (~style) => {
   9 │   <div style> {React.string("This is a ReasonReact card")} </div>;
  10 │ };

  The module or file ReactDOMRe can't be found.
  - If it's a third-party dependency:
    - Did you list it in bsconfig.json?
    - Did you run `bsb` instead of `bsb -make-world`
      (latter builds third-parties)?
  - Did you include the file's directory in bsconfig.json?

bsb: [2/6] src/ReducerFromReactJSDocs/ReducerFromReactJSDocs-MyReactApp.cmj
FAILED: src/ReducerFromReactJSDocs/ReducerFromReactJSDocs-MyReactApp.cmj

  We've found a bug for you!
  D:\reasonml\gol\my-react-app\src\ReducerFromReactJSDocs\ReducerFromReactJSDocs.re:5:23-43

  3 │
  4 │ // A little extra we've put, because the ReactJS example has no styling
  5 │ let leftButtonStyle = ReactDOMRe.Style.make(~borderRadius="4px 0px 0px
      4px", ~width="48px", ());
  6 │ let rightButtonStyle = ReactDOMRe.Style.make(~borderRadius="0px 4px 4px
       0px", ~width="48px", ());
  7 │ let containerStyle = ReactDOMRe.Style.make(~display="flex", ~alignItems
      ="center", ~justifyContent="space-between", ());

  The module or file ReactDOMRe can't be found.
  - If it's a third-party dependency:
    - Did you list it in bsconfig.json?
    - Did you run `bsb` instead of `bsb -make-world`
      (latter builds third-parties)?
  - Did you include the file's directory in bsconfig.json?

bsb: [3/6] src/ReasonUsingJSUsingReason/ReasonUsingJSUsingReason-MyReactApp.cmj
FAILED: src/ReasonUsingJSUsingReason/ReasonUsingJSUsingReason-MyReactApp.cmj

  We've found a bug for you!
  D:\reasonml\gol\my-react-app\src\ReasonUsingJSUsingReason\ReasonUsingJSUsingReason.re:9:1-10:54

   7 │ // All you need to do to use a ReactJS component in ReasonReact, is to
        write the lines below!
   8 │ // reasonml.github.io/reason-react/docs/en/components#import-from-js
   9 │ [@react.component] [@bs.module]
  10 │ external make: unit => React.element = "./ReactJSCard";

  The module or file React can't be found.
  - If it's a third-party dependency:
    - Did you list it in bsconfig.json?
    - Did you run `bsb` instead of `bsb -make-world`
      (latter builds third-parties)?
  - Did you include the file's directory in bsconfig.json?

bsb: [4/6] src/FetchedDogPictures/FetchedDogPictures-MyReactApp.cmj
FAILED: src/FetchedDogPictures/FetchedDogPictures-MyReactApp.cmj

  We've found a bug for you!
  D:\reasonml\gol\my-react-app\src\FetchedDogPictures\FetchedDogPictures.re:10:27-40

   8 │ [@react.component]
   9 │ let make = () => {
  10 │   let (state, setState) = React.useState(() => LoadingDogs);
  11 │
  12 │   // Notice that instead of `useEffect`, we have `useEffect0`. See

  The module or file React can't be found.
  - If it's a third-party dependency:
    - Did you list it in bsconfig.json?
    - Did you run `bsb` instead of `bsb -make-world`
      (latter builds third-parties)?
  - Did you include the file's directory in bsconfig.json?

bsb: [5/6] src/BlinkingGreeting/BlinkingGreeting-MyReactApp.cmj
FAILED: src/BlinkingGreeting/BlinkingGreeting-MyReactApp.cmj

  We've found a bug for you!
  D:\reasonml\gol\my-react-app\src\BlinkingGreeting\BlinkingGreeting.re:3:25-38

  1 │ [@react.component]
  2 │ let make = (~children) => {
  3 │   let (show, setShow) = React.useState(() => true);
  4 │
  5 │   // Notice that instead of `useEffect`, we have `useEffect0`. See

  The module or file React can't be found.
  - If it's a third-party dependency:
    - Did you list it in bsconfig.json?
    - Did you run `bsb` instead of `bsb -make-world`
      (latter builds third-parties)?
  - Did you include the file's directory in bsconfig.json?

FAILED: cannot make progress due to previous errors.
>>>> Finish compiling(exit: 1)

Also I have across whole project these strange errors:
reason-error


bsb version: 8.3.1
npm: 6.14.6
node: 12.18.3
v8: 7.8.279.23-node.39
OS: Windows 10

I am using Windows 10 and it does not work either:

C:\pok\my-react-app> npm run build

my-react-app@0.1.0 build
bsb -make-world

ninja: error: 'C:/pok/my-react-app/node_modules/reason-react/src/React.re', needed by 'src/React.reast', missing and no known rule to make it
Failure: C:\pok\my-react-app\node_modules\bs-platform\win32\ninja.exe
Location: C:\pok\my-react-app\node_modules\reason-react\lib\bs
npm ERR! code 2
npm ERR! path C:\pok\my-react-app
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "bsb -make-world"

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MilanBella\AppData\Local\npm-cache_logs\2020-10-25T06_31_26_328Z-debug.log
PS C:\pok\my-react-app>`

tracked here rescript-lang/rescript-compiler#4766
the root cause is that npm changed modification time to a weird date 1985..
will be fixed in next release