Build fails
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.
[email protected] 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.
Solution:Jump to solution
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
47 Replies
Project ID:
f42e62b6-006e-4fc9-9de2-0d28908605aa
f42e62b6-006e-4fc9-9de2-0d28908605aa
@Fragly I'm currently busy, would you have the time to help here?
I can try
Would you mind sharing your build logs using this link?
https://bookmarklets.up.railway.app/log-downloader/
It's almost 1 am for me, gonna hit the hay
:gx_aightimaheadout:
well you tried
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
please send your package.json
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"
}
}
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.
so let's work through everything so we can get you setup for easy deployments to railway!
first please go and disconnect your repository from your service via it's settings page
OK, thank you for your message. I uninstall the Railway App from my Github repo.
sorry, that is not what I meant
please do not do that
Ah, sorry. I will re-install it.
disconnect your github repository from your railway service via the services settings page
for context this has nothing to do with the railway github bot
OK, within the https://railway.app/account I disconnected within the "Account Integrations". I hope this is what you meant.
that's also not what I meant, I felt like I was quite clear here, what is left unclear exactly?
Ok, I will revert it. Since I am new in this topic, I may need closer assistance. Sorry for that.
please help me to understand what is left unclear
Where do I find the "services settings page"?
open the service
going forward if you are unsure about something i say, please ask instead of going and doing something potentially undesired again
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.
May you share a screenshot?
starting from https://railway.app/dashboard
open your desired project, open your desired service, click on its settings tab, click on the disconnect button besides the github repository
OK, thank you. I did so.
have you since reinstalled the railway github bot and linked your github account back to your railway account?
Yes, I did.
would it be possible for you to share your github repository with me?
I made it temporarily public: https://github.com/lkerbage/qv-bestehen
GitHub
GitHub - lkerbage/qv-bestehen
Contribute to lkerbage/qv-bestehen development by creating an account on GitHub.
lots to unpack here
lets start with just a screenshot of your railway project
what do you mean by that?
what part of my message needs clarification? what a screenshot is or what a railway project is?
Ah, ok, I thought this was a special term.
I suppose you want a screenshot of the account settings.
i would like a screenshot of the project canvas
Where do I find the project canvas?
starting from https://railway.app/dashboard
open your desired project, take a screenshot, send screenshot to me
Maybe this is more useful:
I need to go and I will be back tomorrow. Thank you very much for your time and your patience so far.
yes that what i wanted, but i noticed you have your github repository is still attached, i had previously asked you to disconnect it
okay good, can you make your repo public again?
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?
Yes, sure. I just invited you as collaborator.
okay, please add me to your railway project too, my email is [email protected]
ok, done.
okay ill go ahead and make the needed changes, please ignore any errors while i get things worked out
OK, thank you.
Solution
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
Thank you, Brody! Could you give me any suggestions on how to improve my design and architecture, respectively?
I would have personally gone for a isolated monorepo, but if this works for you then you're fine
👍