flaviuse / mern-authentication

MERN stack authentication boilerplate: password reset, email verification, server sessions, redux, typescript, hooks and docker for dev and prod.
https://mern-auth-client.herokuapp.com/login
MIT License
439 stars 95 forks source link

Error: module not found: app/build/index.js #173

Open PhantomGuru0427 opened 1 year ago

PhantomGuru0427 commented 1 year ago

docker compose -f docker-compose.prod.yml --env-file client.prod.env up --build I am trying to run this command for production mode, but it caused error. In server, docker file is CMD ["yarn", "start:prod"] package.json is "scripts": { "build": "tsc-alias --project tsconfig.json", "dev": "ts-node-dev --respawn -r tsconfig-paths/register index.ts", "start": "yarn build && node build/index.js", "start:prod": "node build/index.js", "ci": "yarn install --frozen-lockfile" },

flaviuse commented 1 year ago

Please share your error when you run the command. Have you created a server.prod.env file ? This is required to get it run.

Edit: Error: module not found: app/build/index.js ok missed the error.. seems something went wrong when building the server code in docker build.

I'll try to have a look after Github outage

muhammadbasitobaid commented 3 weeks ago

Hi @flaviuse i guess you need to update the build script in package.json according to tsc-alias documentation: "build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json", should do it!