rrdelaney / reason-scripts

:beginner: Create a ReasonML and React development environment
MIT License
628 stars 58 forks source link

Cannot start/build new project #39

Closed nhducit closed 6 years ago

nhducit commented 6 years ago

Cannot start/build project. reproduce steps:

$ npm install -g bs-platform create-react-app
$ create-react-app <app-name> --scripts-version reason-scripts
$ cd <app-name>
$ npm start

error:

yarn run v1.5.1
$ react-scripts build
Creating an optimized production build...
Failed to compile.

./src/index.re
[1/4] Building src/ReactDOMRe.mlast
FAILED: src/ReactDOMRe.mlast
/usr/local/lib/node_modules/bs-platform/lib/bsc.exe -pp "/usr/local/lib/node_modules/bs-platform/lib/refmt3.exe --print binary"    -w -30-40+6+7+27+32..39+44+45+101 -nostdlib -I '/Users/duc/Documents/whiteMouse/my-app/node_modules/bs-platform/lib/ocaml' -bs-no-version-header -no-alias-deps -color always -c -o src/ReactDOMRe.mlast -bs-syntax-only -bs-binary-ast -impl /Users/duc/Documents/whiteMouse/my-app/node_modules/reason-react/src/ReactDOMRe.re
File "/Users/duc/Documents/whiteMouse/my-app/node_modules/reason-react/src/ReactDOMRe.re", line 26, characters 6-7:
Error: 2960: <UNKNOWN SYNTAX ERROR>
File "/Users/duc/Documents/whiteMouse/my-app/node_modules/reason-react/src/ReactDOMRe.re", line 1:
Error: Error while running external preprocessor
Command line: /usr/local/lib/node_modules/bs-platform/lib/refmt3.exe --print binary '/Users/duc/Documents/whiteMouse/my-app/node_modules/reason-react/src/ReactDOMRe.re' > /var/folders/q0/wxdkdc6j6057dgsmwcyrqp5c0000gp/T/ocamlpp1f879d

[2/4] Building src/ReasonReact.mlast
FAILED: src/ReasonReact.mlast
/usr/local/lib/node_modules/bs-platform/lib/bsc.exe -pp "/usr/local/lib/node_modules/bs-platform/lib/refmt3.exe --print binary"    -w -30-40+6+7+27+32..39+44+45+101 -nostdlib -I '/Users/duc/Documents/whiteMouse/my-app/node_modules/bs-platform/lib/ocaml' -bs-no-version-header -no-alias-deps -color always -c -o src/ReasonReact.mlast -bs-syntax-only -bs-binary-ast -impl /Users/duc/Documents/whiteMouse/my-app/node_modules/reason-react/src/ReasonReact.re
File "/Users/duc/Documents/whiteMouse/my-app/node_modules/reason-react/src/ReasonReact.re", line 82, characters 2-3:
Error: 373: <UNKNOWN SYNTAX ERROR>
File "/Users/duc/Documents/whiteMouse/my-app/node_modules/reason-react/src/ReasonReact.re", line 1:
Error: Error while running external preprocessor
Command line: /usr/local/lib/node_modules/bs-platform/lib/refmt3.exe --print binary '/Users/duc/Documents/whiteMouse/my-app/node_modules/reason-react/src/ReasonReact.re' > /var/folders/q0/wxdkdc6j6057dgsmwcyrqp5c0000gp/T/ocamlppe8825f

ninja: error: rebuilding 'build.ninja': subcommand failed
Failure: /usr/local/lib/node_modules/bs-platform/lib/ninja.exe
 Location: /Users/duc/Documents/whiteMouse/my-app/node_modules/reason-react/lib/bs

error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c react-scripts build
Directory: /Users/duc/Documents/whiteMouse/my-app
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/duc/Documents/whiteMouse/my-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
nhducit commented 6 years ago

~It seems yarn does't work well with bs-platform then I suggest we remove the new project creation instructions with yarn~

same issue with new project which is created by using npm

rrdelaney commented 6 years ago

Closing as a duplicate of #35. Some people have had luck upgrading their yarn/npm and bs-platform versions to fix this, although there is no known root cause.

nhducit commented 6 years ago

thanks @rrdelaney for your information