rescript-react-native / rescript-react-navigation

ReScript bindings for React Navigation
MIT License
74 stars 28 forks source link

Something error was happened at building project #30

Closed Nagatatz closed 4 years ago

Nagatatz commented 4 years ago

summary

I copied Example.re as root file App.re, in local project. I can't run "yarn re:build", alias of "bsb -clean-world -make-world"

The problem

The stdout result is below.

$ yarn bsb -clean-world -make-world
Cleaning... 50 files.
Cleaning... 572 files.
Cleaning... 9 files.
Cleaning... 2 files.
[37/37] Building src/ReactDOMRe.cmj
[366/366] Building src/apis/Animated-ReactNative.cmj
[2/34] Building src/Core.reast
FAILED: src/Core.reast 
<project_path>/node_modules/bs-platform/lib/bsc.exe  -w -30-40+6+7+27+32..39+44+45+101+102-105 -color always -bs-jsx 3 -bs-quiet -bs-no-version-header -o src/Core.reast -bs-syntax-only -bs-binary-ast <project_path>/node_modules/reason-react-navigation/src/Core.re
File "<project_path>/node_modules/reason-react-navigation/src/Core.re", line 31, characters 65-66:
Error: Unclosed "{" (opened line 16, column 56)

  We've found a bug for you!
 <project_path>/node_modules/reason-react-navigation/src/Core.re

  There's been an error running Reason's parser on a file.
  The error location should be slightly above this message.
  Please file an issue on github.com/facebook/reason. Thanks!

[11/34] Building src/NavigationActions.reast
FAILED: subcommand failed.
Failure: <project_path>/node_modules/bs-platform/lib/ninja.exe 
 Location: <project_path>/node_modules/reason-react-navigation/lib/bs
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It seems that there is no syntax error in Core.re. But I'm a begginer of ReasonML, so I cannot determine the exact cause.

How to reproduce

create reason react native app

$ npx @react-native-community/cli init --template @reason-react-native/template MyApp

add reason-react-navigation

$ yarn add reason-react-navigation 

add "reason-react-navigation" to bs-dependencies of bsconfig.json

then run

$ yarn bsb -clean-world -make-world

Environment

macOS Mojave 10.14.6 node v10.16.0 packages

"dependencies": {
    "react": "^16.9.0",
    "react-native": "^0.61.0",
    "reason-react": "^0.7.0",
    "reason-react-native": "^0.61.0",
    "reason-react-navigation": "^5.0.0-beta.0"
  },
  "devDependencies": {
    "@babel/core": "^7.6.2",
    "@babel/runtime": "^7.6.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "bs-platform": "^7.0.0",
    "eslint": "^6.5.1",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.56.0",
    "react-test-renderer": "16.9.0"
  },
MoOx commented 4 years ago

Please try:

Now compilation should work. I think rrnav needs bs-p > 7.1

Nagatatz commented 4 years ago

Thank you very much!