Starting the app with vite in github action

I tried the vite experimental feature and found an issue when I try to run my e2e tests inside a github action, here is the error I am getting while starting the server with yarn rw dev

/usr/local/bin/yarn rw dev
yarn run v1.22.19
$ /home/runner/work/web/web/node_modules/.bin/rw dev
web | $ /home/runner/work/web/web/node_modules/.bin/cross-env NODE_ENV=development rw-vite-dev
gen | $ /home/runner/work/web/web/node_modules/.bin/rw-gen-watch
api | $ /home/runner/work/web/web/node_modules/.bin/cross-env NODE_ENV=development NODE_OPTIONS=--enable-source-maps yarn nodemon --quiet --watch /home/runner/work/web/web/redwood.toml --exec 'yarn rw-api-server-watch --port 8911 --debug-port 18911 | rw-log-formatter'
web | import-im6.q16: unable to open X server `' @ error/import.c/ImportImageCommand/346.
web | import-im6.q16: unable to open X server `' @ error/import.c/ImportImageCommand/346.
web | /home/runner/work/web/web/web/node_modules/.bin/rw-vite-dev: 5: Syntax error: "(" unexpected
web | error Command failed with exit code 2.

Any idea?

Building on Docker gives the same result here, so if you have the answer, the next reader will be glad. :grin:

1 Like

Hey @Standup75

yarn run v1.22.19

Outdated yarn or node version maybe?

Nice catch!

Just wanted to let the others know :wink:

Here one possible trick to force version inside the docker image:

ENV YARN_VERSION 3.6.1
RUN yarn policies set-version $YARN_VERSION