R
Railway4mo ago
Sky

I can't get my frontend vue3+vite app to build in my monorepo

I've been plagued by error after error, but i feel like I keep getting closer and closer. I am running a .net back end with a vue + vite front end. I have set up the .net and vue front end separately on railway, but I have them set up to do a proxy and launch together when i debug locally. Because of this, i think it's just been super problematic getting a production ready build for vite on railway. I am not totally sure. Project ID: 730d9df6-b69f-4114-b4ca-d92859e4f4b0 Here is the error i'm currently getting:
No description
26 Replies
Percy
Percy4mo ago
Project ID: 730d9df6-b69f-4114-b4ca-d92859e4f4b0
Brody
Brody4mo ago
I assume you've ran a build locally without issues right?
Sky
Sky4mo ago
Yeah I can build locally without any issues. I also have the full build log here if this is helpful:
Brody
Brody4mo ago
what version of node do you use locally
Sky
Sky4mo ago
would that just be determined by running node -v? if so, v20.9.0
Brody
Brody4mo ago
try setting engines.node to 20 in your package.json then your also trying to run a development server on railway by the looks of it, vite doesn't come with a production ready web server but we'll tackle that after the build doesn't fail
Sky
Sky4mo ago
would it just be like this?
No description
Sky
Sky4mo ago
pushing now, getting this now:
No description
Brody
Brody4mo ago
is the build using node 20 now?
Sky
Sky4mo ago
No description
Sky
Sky4mo ago
I believe so
Brody
Brody4mo ago
send your package.json please
Sky
Sky4mo ago
Brody
Brody4mo ago
I see react-fontawsome, but I'm not seeing vue-fontawsome I'm not sure why you're installing react-fontawsome though?
Sky
Sky4mo ago
Shouldn't even have react-fontawesome, was testing something earlier trying to get it work with a react template. But i dont believe there is a specific vue front awesome, is there? Removing react now
Brody
Brody4mo ago
you're trying to import it, so check
Sky
Sky4mo ago
No specific vue font awesome, just the standard ones. Font awesome does have specific react imports. I've removed it, re-ran. Same error
Brody
Brody4mo ago
delete your local node_modules, reinstall them, and then try another build
Sky
Sky4mo ago
something broke locally, and i cant run a build anymore. Sorry, give me a minute to figure this out. Alright, I deleted the node_modules folder, tried to reinstall and just started running into non-stop errors running locally. Ended up just scrapping and redoing the the vue project. After i finished and committed the changes, it does look like the railway server builded successfully I am not sure if its working, i think you mentioned something about running a dev server on railway
Brody
Brody4mo ago
yep now let's tackle that https://github.com/railwayapp-templates/vue-starter copy the nixpacks.toml and Caddyfile from this repo into yours
Sky
Sky4mo ago
Okay that is done
Brody
Brody4mo ago
does it work?
Sky
Sky4mo ago
it keeps crashing, with the following error
No description
Brody
Brody4mo ago
if you have a custom start command set in the service settings please remove it
Sky
Sky4mo ago
It's been deployed and running for 45 minutes! Thanks for you help!
Brody
Brody4mo ago
no problem!