Build fails
lkerbage
TRIALOP

2 years ago

I want to deploy a web-app (React & Vite) and I fail to deploy it. The deploy logs say the following:
npm WARN config production Use --omit=dev instead.

qv-bestehen@1.0.0 start tsc && cross-env NODE_OPTIONS=--max-old-space-size=16384 vite build --mode=production vite v5.0.11 building for production… transforming… (here crashes the build after several seconds). Every hint is highly appreciated. Thank you.

59 Replies

lkerbage
TRIALOP

2 years ago

f42e62b6-006e-4fc9-9de2-0d28908605aa


brody
EMPLOYEE

2 years ago

@Fragly I'm currently busy, would you have the time to help here?


dev
MODERATOR

2 years ago

I can try


dev
MODERATOR

2 years ago

Would you mind sharing your build logs using this link?
https://bookmarklets.up.railway.app/log-downloader/


dev
MODERATOR

2 years ago

It's almost 1 am for me, gonna hit the hay


dev
MODERATOR

2 years ago

<:gx_aightimaheadout:811578944323059744>


brody
EMPLOYEE

2 years ago

well you tried


lkerbage
TRIALOP

2 years ago

Thank you very much, @Brody and @Fragly for your messages. Please find the logs on https://www.tutorat.ch/build.log and https://www.tutorat.ch/deployment.log


brody
EMPLOYEE

2 years ago

please send your package.json


lkerbage
TRIALOP

2 years ago

For production, I used another proxy of course. My package.json is as follows:
{
"name": "qv-bestehen",
"private": true,
"version": "1.0.0",
"type": "module",
"proxy": "http://localhost:8000",
"scripts": {
"dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint qv-bestehen --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"backend": "nodemon backend/index.cjs --host",
"start": "tsc && cross-env NODE_OPTIONS=--max-old-space-size=16384 vite build --mode=production"
},
"dependencies": {
"@firebase/firestore": "^4.4.3",
"@railway/cli": "^3.5.2",
"@reduxjs/toolkit": "^2.1.0",
"bootstrap": "^5.3.2",
"classnames": "^2.5.1",
"cors": "^2.8.5",
"cross-env": "^7.0.3",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"firebase": "^10.7.1",
"i18next": "^23.7.16",
"nodemailer": "^6.9.10",
"react": "^18.2.0",
"react-bootstrap": "^2.9.2",
"react-bootstrap-icons": "^1.10.3",
"react-dom": "^18.2.0",
"react-i18next": "^14.0.0",
"react-redux": "^9.1.0",
"react-router-dom": "^6.21.2"
},
"devDependencies": {
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.55.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"nodemon": "^3.0.3",
"prettier": "^3.2.1",
"typescript": "^5.3.3",
"vite": "^5.0.8"
}
}


brody
EMPLOYEE

2 years ago

using a proxy is just a bandaid solution for local development, it is far from the most ideal way to work on local frontend and backend development and very often causes issues when deploying into a production environment such as railway, it's not your main issue, but it's one of several issues.


brody
EMPLOYEE

2 years ago

so let's work through everything so we can get you setup for easy deployments to railway!


brody
EMPLOYEE

2 years ago

first please go and disconnect your repository from your service via it's settings page


lkerbage
TRIALOP

2 years ago

OK, thank you for your message. I uninstall the Railway App from my Github repo.


brody
EMPLOYEE

2 years ago

sorry, that is not what I meant


brody
EMPLOYEE

2 years ago

please do not do that


lkerbage
TRIALOP

2 years ago

Ah, sorry. I will re-install it.


brody
EMPLOYEE

2 years ago

disconnect your github repository from your railway service via the services settings page


brody
EMPLOYEE

2 years ago

for context this has nothing to do with the railway github bot


lkerbage
TRIALOP

2 years ago

OK, within the https://railway.app/account I disconnected within the "Account Integrations". I hope this is what you meant.


brody
EMPLOYEE

2 years ago

that's also not what I meant, I felt like I was quite clear here, what is left unclear exactly?


lkerbage
TRIALOP

2 years ago

Ok, I will revert it. Since I am new in this topic, I may need closer assistance. Sorry for that.


brody
EMPLOYEE

2 years ago

please help me to understand what is left unclear


lkerbage
TRIALOP

2 years ago

Where do I find the "services settings page"?


brody
EMPLOYEE

2 years ago

open the service


brody
EMPLOYEE

2 years ago

going forward if you are unsure about something i say, please ask instead of going and doing something potentially undesired again


lkerbage
TRIALOP

2 years ago

OK, understood. I don't find the "service" within the railway app dashboard. I'm not normally so slow on the uptake but here I am on the fence, sorry.


lkerbage
TRIALOP

2 years ago

May you share a screenshot?


brody
EMPLOYEE

2 years ago

starting from
open your desired project, open your desired service, click on its settings tab, click on the disconnect button besides the github repository


lkerbage
TRIALOP

2 years ago

OK, thank you. I did so.


brody
EMPLOYEE

2 years ago

have you since reinstalled the railway github bot and linked your github account back to your railway account?


lkerbage
TRIALOP

2 years ago

Yes, I did.


brody
EMPLOYEE

2 years ago

would it be possible for you to share your github repository with me?


lkerbage
TRIALOP

2 years ago

I made it temporarily public: https://github.com/lkerbage/qv-bestehen


brody
EMPLOYEE

2 years ago

lots to unpack here


brody
EMPLOYEE

2 years ago

lets start with just a screenshot of your railway project


lkerbage
TRIALOP

2 years ago

what do you mean by that?


brody
EMPLOYEE

2 years ago

what part of my message needs clarification? what a screenshot is or what a railway project is?


lkerbage
TRIALOP

2 years ago

Ah, ok, I thought this was a special term.


lkerbage
TRIALOP

2 years ago

I suppose you want a screenshot of the account settings.


brody
EMPLOYEE

2 years ago

i would like a screenshot of the project canvas


lkerbage
TRIALOP

2 years ago

Where do I find the project canvas?

1218603720279986400


brody
EMPLOYEE

2 years ago

starting from
open your desired project, take a screenshot, send screenshot to me


lkerbage
TRIALOP

2 years ago

Maybe this is more useful:

1218607463788445700
1218607464157810700


lkerbage
TRIALOP

2 years ago

I need to go and I will be back tomorrow. Thank you very much for your time and your patience so far.


brody
EMPLOYEE

2 years ago

yes that what i wanted, but i noticed you have your github repository is still attached, i had previously asked you to disconnect it


lkerbage
TRIALOP

2 years ago

1218804996674420700


brody
EMPLOYEE

2 years ago

okay good, can you make your repo public again?


brody
EMPLOYEE

2 years ago

we have spent quite the amount of time finishing only step one of disconnecting the repo from the service, so in the interest of efficient time usage, what do you think of adding me to your github repo and your railway project so i can go ahead and get this all setup for you?


lkerbage
TRIALOP

2 years ago

Yes, sure. I just invited you as collaborator.


brody
EMPLOYEE

2 years ago

okay, please add me to your railway project too, my email is brodyover@gmail.com


lkerbage
TRIALOP

2 years ago

ok, done.


brody
EMPLOYEE

2 years ago

okay ill go ahead and make the needed changes, please ignore any errors while i get things worked out


lkerbage
TRIALOP

2 years ago

OK, thank you.


brody
EMPLOYEE

2 years ago

looks like you are setup, you will still likely have some code stuff to figure out, like using the correct url paths and what not, on account of the backend and frontend being separate services since this is the correct way to set this app up


lkerbage
TRIALOP

2 years ago

Thank you, Brody! Could you give me any suggestions on how to improve my design and architecture, respectively?


brody
EMPLOYEE

2 years ago

I would have personally gone for a isolated monorepo, but if this works for you then you're fine


lkerbage
TRIALOP

2 years ago

👍


durga-parkhe
FREE

7 months ago

My app building successfully build but when trying to deploy that time giving error:

Starting Container

npm error code ENOENT

npm error syscall open

npm error path /app/package.json

npm error errno -2

npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/app/package.json'

npm error enoent This is related to npm not being able to find a file.

npm error enoent

npm error A complete log of this run can be found in: /root/.npm/_logs/2025-07-30T05_11_35_931Z-debug-0.log

Can you help me here?


Loading...