Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PhantomGuru0427 opened this issue Jun 26, 2023 · 2 comments
Open

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

PhantomGuru0427 opened this issue Jun 26, 2023 · 2 comments

Comments

@PhantomGuru0427
Copy link

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
Copy link
Owner

flaviuse commented Jun 29, 2023

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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants