R
Railway9mo ago
Lo

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:
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
Jump to solution
47 Replies
Percy
Percy9mo ago
Project ID: f42e62b6-006e-4fc9-9de2-0d28908605aa
Lo
LoOP9mo ago
f42e62b6-006e-4fc9-9de2-0d28908605aa
Brody
Brody9mo ago
@Fragly I'm currently busy, would you have the time to help here?
Fragly
Fragly9mo ago
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:
Brody
Brody9mo ago
well you tried
Lo
LoOP9mo 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
Brody9mo ago
please send your package.json
Lo
LoOP9mo 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
Brody9mo 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. 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
Lo
LoOP9mo ago
OK, thank you for your message. I uninstall the Railway App from my Github repo.
Brody
Brody9mo ago
sorry, that is not what I meant please do not do that
Lo
LoOP9mo ago
Ah, sorry. I will re-install it.
Brody
Brody9mo ago
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
Lo
LoOP9mo ago
OK, within the https://railway.app/account I disconnected within the "Account Integrations". I hope this is what you meant.
Brody
Brody9mo ago
that's also not what I meant, I felt like I was quite clear here, what is left unclear exactly?
Lo
LoOP9mo ago
Ok, I will revert it. Since I am new in this topic, I may need closer assistance. Sorry for that.
Brody
Brody9mo ago
please help me to understand what is left unclear
Lo
LoOP9mo ago
Where do I find the "services settings page"?
Brody
Brody9mo ago
open the service going forward if you are unsure about something i say, please ask instead of going and doing something potentially undesired again
Lo
LoOP9mo 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. May you share a screenshot?
Brody
Brody9mo ago
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
Lo
LoOP9mo ago
OK, thank you. I did so.
Brody
Brody9mo ago
have you since reinstalled the railway github bot and linked your github account back to your railway account?
Lo
LoOP9mo ago
Yes, I did.
Brody
Brody9mo ago
would it be possible for you to share your github repository with me?
Lo
LoOP9mo ago
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.
Brody
Brody9mo ago
lots to unpack here lets start with just a screenshot of your railway project
Lo
LoOP9mo ago
what do you mean by that?
Brody
Brody9mo ago
what part of my message needs clarification? what a screenshot is or what a railway project is?
Lo
LoOP9mo ago
Ah, ok, I thought this was a special term. I suppose you want a screenshot of the account settings.
Brody
Brody9mo ago
i would like a screenshot of the project canvas
Lo
LoOP9mo ago
Where do I find the project canvas?
No description
Brody
Brody9mo ago
starting from https://railway.app/dashboard open your desired project, take a screenshot, send screenshot to me
Lo
LoOP9mo ago
Maybe this is more useful:
No description
No description
Lo
LoOP9mo ago
I need to go and I will be back tomorrow. Thank you very much for your time and your patience so far.
Brody
Brody9mo 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
Lo
LoOP9mo ago
No description
Brody
Brody9mo ago
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?
Lo
LoOP9mo ago
Yes, sure. I just invited you as collaborator.
Brody
Brody9mo ago
okay, please add me to your railway project too, my email is [email protected]
Lo
LoOP9mo ago
ok, done.
Brody
Brody9mo ago
okay ill go ahead and make the needed changes, please ignore any errors while i get things worked out
Lo
LoOP9mo ago
OK, thank you.
Solution
Brody
Brody9mo 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
Lo
LoOP9mo ago
Thank you, Brody! Could you give me any suggestions on how to improve my design and architecture, respectively?
Brody
Brody9mo ago
I would have personally gone for a isolated monorepo, but if this works for you then you're fine
Lo
LoOP9mo ago
👍
Want results from more Discord servers?
Add your server