Error with reason-apollo and reason-react


I’ve just setup a skeleton project with reason-apollo and reason-react.

I created a trivial .re file and in VSCode I’m seeing this error:

Failure("Ast_mapper: OCaml version mismatch or malformed input")
File "/Users/kevan.stannard/dev/hello-graphql-reason/node_modules/.lsp/Hello-YourProjectName.ast", line 1:
Error: Error while running external preprocessor
Command line: /Users/kevan.stannard/dev/hello-graphql-reason/node_modules/graphql_ppx/ppx '/var/folders/fc/4yp7tfsj2j30rtd84_w3nh280000gp/T/camlppx62afbf' '/var/folders/fc/4yp7tfsj2j30rtd84_w3nh280000gp/T/camlppx41e7e7'

While investigating I found this page:

Checking versions:

$ bsc -version
BuckleScript 7.0.1 ( Using OCaml:4.06.1+BS )
$ ocaml -version
The OCaml toplevel, version 4.09.0

Any suggestions appreciated. Also, not sure which project to report this on, so posting here first.


'reason-vscode' plugin errors on incompatible versions ocaml/preprocessor

Hey it looks like the reason-apollo package is using a deprecated compiler extension:

If you check the upgrade guide you’ll see it’s actually recommended to move from graphql_ppx to graphql_ppx_re:

In your case for now you can actually just downgrade BuckleScript to the last known stable version which should work with reason-apollo, version 5.2.1.

But in the mid-to-long term you can (should) raise an issue with them to upgrade (or check if they have one already).


@yawaramin great, thank you!