#Cannot start my dev env with vite on docker but working like a charm on my macos

1 messages · Page 1 of 1 (latest)

jaunty mulch
#

Hi i have an old project in react that I updated to bun with vite all working like charm on my comp but not on docker.
I'm getting 2 differentes issue depending of the configuration of my dockerfile and dockercompose.
here are the 2 issues:
first is when volumes are setting up like this:
volumes:
- .:/app/src

failed to load config from /app/vite.config.js
react_client | error when starting dev server:
react_client | Error: config must export or return an object.
react_client | at <anonymous> (/app/node_modules/vite/dist/node/chunks/dep-CDnG8rE7.js:66483:17)
react_client | at processTicksAndRejections (:7:39)
react_client | error: script "start" exited with code 1

second is when volumes is setting up like this:
volumes:
- .:/app
error: Cannot find module @rollup/rollup-linux-arm64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try npm i again after removing both package-lock.json and node_modules directory.
react_client | cause: {
react_client | "name": "ResolveMessage",
react_client | "position": null,
react_client | "message": "Cannot find module "@rollup/rollup-linux-arm64-gnu" from "/app/node_modules/rollup/dist/native.js"",
react_client | "level": "error",
react_client | "specifier": "@rollup/rollup-linux-arm64-gnu",
react_client | "importKind": "require-call",
react_client | "referrer": "/app/node_modules/rollup/dist/native.js"
react_client | }
react_client |
react_client | at requireWithFriendlyError (/app/node_modules/rollup/dist/native.js:59:9)
react_client | at /app/node_modules/rollup/dist/native.js:68:76
react_client |
react_client | Bun v1.1.30 (Linux arm64)
react_client | error: script "start" exited with code 1

any solution ?

GitHub

the package manager for JavaScript. Contribute to npm/cli development by creating an account on GitHub.

#

here is my docker compose:

services:
react_client:
container_name: react_client
restart: always
build:
context: ./
args:
- PORT_TO_USE=${FRONTEND_PORT}
volumes:
- .:/app/src
ports:
- ${FRONTEND_PORT}:${FRONTEND_PORT}
env_file:
- .env
# need it for react-scripts version > 3.4.0
stdin_open: true
networks:
- frontnet
networks:
frontnet:
external:
name: frontnet