Build error

i can not build my react project
45 Replies
Percy
Percy2y ago
Project ID: cc6720ef-d0c5-4c94-949d-1552ca86f88a
Yousef
YousefOP2y ago
cc6720ef-d0c5-4c94-949d-1552ca86f88a project id project/cc6720ef-d0c5-4c94-949d-1552ca86f88a/service/6b001e48-5e91-4a4e-b615-3a6cc2fd70b7 Please any one see this reply
Yousef
YousefOP2y ago
Build log
Yousef
YousefOP2y ago
i don't have any other host @Finn - uses centos
Finn
Finn2y ago
│ npm run start - what does that do?
Yousef
YousefOP2y ago
starts the project
Finn
Finn2y ago
yes, but what does it do.... how does it do it rather
Yousef
YousefOP2y ago
can you be more specific
Yousef
YousefOP2y ago
Finn
Finn2y ago
not really oh so this is a CRA project? is it an spa? or is it ssr'ed?
Yousef
YousefOP2y ago
yep
Finn
Finn2y ago
Create a New React App – React
A JavaScript library for building user interfaces
Finn
Finn2y ago
ok so you will need to use the nixpacks staticfile provider ill see if theres a template
Yousef
YousefOP2y ago
alright, i'll wait
Yousef
YousefOP2y ago
it's the 3rd one ig @Finn - uses centos
Finn
Finn2y ago
first i think you need a file like this
Finn
Finn2y ago
Yousef
YousefOP2y ago
what is that file
Finn
Finn2y ago
containing
root: dist
root: dist
just a file called Staticfile
Yousef
YousefOP2y ago
Okay
Yousef
YousefOP2y ago
Finn
Finn2y ago
that might actually be all you need yeah like that
Yousef
YousefOP2y ago
should i use the first one here?
Finn
Finn2y ago
make sure your root directory is set to client-front in settings if you want to remake your project yeah ide 100% recommed vite
Yousef
YousefOP2y ago
which settings
Finn
Finn2y ago
if you dotn want to start again you dont have to the settings of your service same place you got your logs from
Yousef
YousefOP2y ago
yea also i could not deploy the back-front end in the same service right @Finn - uses centos ? so i create empty service for now
Finn
Finn2y ago
seperate services same project
Yousef
YousefOP2y ago
Ok
Finn
Finn2y ago
its possible using a dockerfile if you want to save money
Yousef
YousefOP2y ago
i'll search of what is dockerfile
Finn
Finn2y ago
it will require quite a bit of effort you need a container with an Nginx server + node installed To get you started this is how you can install node on a alpine linux container
apk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
apk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Yousef
YousefOP2y ago
I still can not build the project <#1054423917000925244> have same error but i didn't get the solution
Finn
Finn2y ago
whats the issue now?
Finn
Finn2y ago
and waht do the deploy logs look like? from the logs thereit looks like its built although those logs are truncated
Yousef
YousefOP2y ago
there is none
Finn
Finn2y ago
and further down the build logs does it build properly?
Yousef
YousefOP2y ago
yes it started to but then it crashes ig
Finn
Finn2y ago
If i were you ide suggest just hosting the backend on railway and host the frontend on vercel
Yousef
YousefOP2y ago
what is vercel is that other host
Finn
Finn2y ago
https://vercel.app its spesficicly for websites then you can host the backend here which will hopefully just work
Yousef
YousefOP2y ago
How much does it coast?
Finn
Finn2y ago
idk. i have the pro membership likely free
Want results from more Discord servers?
Add your server