I’m trying to build one of my rescript projects, in a docker image, but at the npm install stage, I get the following error:
> rescript build -with-deps
...
FAILED: src/api.ast
sh: /home/app/node_modules/rescript/linux/refmt.exe: not found
We've found a bug for you!
/home/app/src/api.re
There's been an error running Reason's parser on a file.
If the message doesn't help, check for errors slightly above.
Please file an issue on github.com/facebook/reason. Thanks!
FAILED: cannot make progress due to previous errors.
I believe that I just miss some library somewhere or use the wrong version of something. Here is my Dockerfile :
FROM node:19-alpine
WORKDIR /home/app
RUN apk --update --upgrade --no-cache add bash cairo-dev make pango-dev gdk-pixbuf curl &&
\
ln -s /usr/bin/python3 /usr/bin/python
COPY package.json ./
COPY bsconfig.json ./
COPY src ./src
COPY __tests__ ./__tests__
RUN apk add --no-cache --virtual .build-deps gcc g++ python3-dev musl-dev jpeg-dev zlib-dev
libffi-dev
RUN npm install
what version of rescript are you using? Reason syntax is being deprecated, did you try converting your project to Rescript syntax and see if it fixed it?
I didn’t know I had used a reason syntax… Why don’t the compiler just indicate the syntax errors then ?
I’m going to try that conversion. Is there a pointer to the procedure to do that ?
That file is really simple, maybe you can tell me what syntax error it contains:
open Express
open Routes
let app = express()
let port = 3000
App.get(app, ~path="/", healthCheck)
App.get(app, ~path="/compile/", postCompile)
let server = App.listen(
app,
~port,
~onListen=_ => {
Js.log(`Listening at http://localhost:${Js.Int.toString(port)}`)
},
(),
)