Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The value ++ can't be found #105

Closed
prashantham opened this issue Oct 28, 2017 · 9 comments
Closed

The value ++ can't be found #105

prashantham opened this issue Oct 28, 2017 · 9 comments

Comments

@prashantham
Copy link

Hi,
I am trying out ReasonML. Did the global installation and bs-platform.
Created the ap using bsb -init my-first-app -theme basic-reason.
But when i try out the examples i get error above.
example: let x = "Hello" ++ "World";

`> [email protected] start /Users/prashanth/workspace/reasonml/my-first-app

bsb -make-world -w

Start compiling
Rebuilding since just get started
ninja: Entering directory lib/bs' ninja: no work to do. Finish compiling Start compiling Rebuilding since [ [ 'change', 'demo.re' ] ] ninja: Entering directory lib/bs'
[2/2] Building src/demo.mlast.d
[1/1] Building src/demo-MyFirstApp.cmj
FAILED: src/demo-MyFirstApp.cmj /Users/prashanth/workspace/reasonml/my-first-app/lib/js/src/demo.js src/demo-MyFirstApp.cmi
/usr/local/lib/node_modules/bs-platform/bin/bsc.exe -bs-package-map my-first-app -bs-package-output commonjs:lib/js/src -bs-assume-no-mli -bs-no-builtin-ppx-ml -bs-no-implicit-include -I . -I src -w -30-40+6+7+27+32..39+44+45+101 -nostdlib -I '/Users/prashanth/workspace/reasonml/my-first-app/node_modules/bs-platform/lib/ocaml' -no-alias-deps -color always -bs-re-out -bs-super-errors -o src/demo-MyFirstApp.cmj -c src/demo.mlast

We've found a bug for you!
(No file name)

The value ++ can't be found

ninja: build stopped: subcommand failed.

Finish compiling(exit: 1)
`

@JohannesKaufmann
Copy link

apparently they haven shiped the new syntax yet: reasonml/reason#1445

@relekang
Copy link
Contributor

@prashantham Which version of bs-platform do you have? To be able to use the new syntax you need at least 2.0.0 and set "refmt": 3 in bsconfig.json.

@IwanKaramazow
Copy link
Collaborator

@JohannesKaufmann New syntax has been shipped, that issue contains not finished stuff which will be addressed in the future.

@JohannesKaufmann
Copy link

@IwanKaramazow well I rencently saw the blog post about the new version and thought about giving it a try. So I followed the getting started guide which gives me "bs-platform": "2.0.0" in the "package.json". But all the new stuff like string concatenation (++ instead of ^) and changing an arrays element (myArray[1] instead of myArray.(1)) doesn't work. Using the old syntax it works :-|

And the error messages are very cryptic (at least for a total beginner):


[1/2] Building src/demo.mlast
FAILED: src/demo.mlast
/Users/johannes/.nvm/versions/node/v8.1.3/lib/node_modules/bs-platform/bin/bsc.exe -pp "/Users/johannes/.nvm/versions/node/v8.1.3/lib/node_modules/bs-platform/bin/refmt.exe --print binary"    -w -30-40+6+7+27+32..39+44+45+101 -nostdlib -I '/Users/johannes/Documents/dev/github/my-second-app/node_modules/bs-platform/lib/ocaml' -no-alias-deps -color always -c -o src/demo.mlast -bs-syntax-only -bs-binary-ast -impl /Users/johannes/Documents/dev/github/my-second-app/src/demo.re
File "/Users/johannes/Documents/dev/github/my-second-app/src/demo.re", line 6, characters 12-13:
Error: 1742: Incomplete statement. Did you forget a ";"?

File "/Users/johannes/Documents/dev/github/my-second-app/src/demo.re", line 1, characters 0-0:
Error: Error while running external preprocessor
Command line: /Users/johannes/.nvm/versions/node/v8.1.3/lib/node_modules/bs-platform/bin/refmt.exe --print binary '/Users/johannes/Documents/dev/github/my-second-app/src/demo.re' > /var/folders/3s/jt7_s0l50h3gc1nhqhghb8zw0000gn/T/ocamlppd6a6f6

ninja: error: rebuilding 'build.ninja': subcommand failed
>>>> Finish compiling(exit: 1)

Do you know how to solve this?

@IwanKaramazow
Copy link
Collaborator

Can you upload the project on github & show me the repo?
Little bit hard to guess what's wrong out of the blue.

@JohannesKaufmann
Copy link

https://github.com/JohannesKaufmann/reason-first-app

The generated readme.md also mentions to run npm run watch but the command does not exist in the package.json...

@IwanKaramazow
Copy link
Collaborator

@JohannesKaufmann You're missing "refmt": 3 in your bsconfig.json.

{
  "name": "my-first-app",
  "version": "0.1.0",
  "sources": [
    "src"
  ],
  "bs-dependencies" : [
      // add your dependencies here. You'd usually install them normally through `npm install my-dependency`. If my-dependency has a bsconfig.json too, then everything will work seamlessly.
  ],
  "namespace": true,
  "refmt": 3 // <-- this was missing
}

npm run build builds your app.
npm start starts a watcher & builds you app automatically on change.

The template hasn't been updated 100% correctly. I'll make sure that won't happen again in the future. Feel free to reach out if you have more trouble.
I'll make a PR to your repo.

@prashantham
Copy link
Author

@relekang @IwanKaramazow adding "refmt": 3 worked. Thank you.

@JohannesKaufmann
Copy link

Sorry @IwanKaramazow I totally missed that. Thanks for the pull request, it now works without problems.

I really liked the "Syntax Cheatsheet" but I missed a couple of things:

  • what type of comments are supported (/* */ vs // vs #)
  • converting between data types

The Docs also don't support opening up a link in a new tab if you click on it while holding cmd on a mac.

But other than that the website is really well done and I'm eager to learn more and also try reason-react :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants