I had my app up and running in 5 minutes with Vercel
mparisi76
HOBBYOP

9 months ago

I would rather use Railway for all of my apps, but it is not working well with certain ones.. Not much help here either..

Solved

45 Replies

mparisi76
HOBBYOP

9 months ago

eff4fdbb-16e0-4ffb-bee2-4ad13f2f307e


9 months ago

Hello,

Discord is primarily community support, I believe you have prior threads? community support is only as good as you let it be, stuff like MREs help the community help you.


mparisi76
HOBBYOP

9 months ago

Hi. I'm not sure how to provide an example.. I have the github repo (which is not mine) How do I come up with an acceptable MRE?


9 months ago

If you have a public repo that you are trying to deploy that should be sufficient, please be patient and the community should come to help.


mparisi76
HOBBYOP

9 months ago

Sorry if I seem frustrated.. I've been at this for 5 days.. I have forked this repo: https://github.com/mercurjs/vendor-panel


mparisi76
HOBBYOP

9 months ago

Thank you


9 months ago

You're welcome to bump your previous thread, but unfortunately, the team cannot offer application level support.


mparisi76
HOBBYOP

9 months ago

what does that mean? there's a problem with the application?


mparisi76
HOBBYOP

9 months ago

it runs without any changes on vercel..


mparisi76
HOBBYOP

9 months ago

so there is no problem with the application


9 months ago

Logs or error messages would be helpful. "It's not working" is not enough for us community members to go off of


9 months ago

a problem with the application or how you have set it up.


9 months ago

Railway does not hold your hand as much as Vercel does. It's great that you were able to get your app hosted on Vercel with no effort, but clearly something is pulling you back to Railway. We can help you get there, but you have to help us help you


mparisi76
HOBBYOP

9 months ago

Sure, I understand. The problem is, I've tried many different things and they all fail for different reasons.. I'm not sure at the moment which is the correct approach.. Out of the box with Nixpacks, I get Error: No start command could be found


mparisi76
HOBBYOP

9 months ago

I tried adding a start script to package.json - "start": "vite"


mparisi76
HOBBYOP

9 months ago

but it spins up a server on localhost, which likely is not correct


9 months ago

How do you run the app locally? "vite" does not seem like a correct start command.


9 months ago

Running on localhost should be fine. What makes you think it's not working? Again, please share any logs or errors


mparisi76
HOBBYOP

9 months ago

running locally is just npm run dev


mparisi76
HOBBYOP

9 months ago

in Vercel, the only thing I had to do was override the build command with yarn run build:preview


9 months ago

That runs a dev environment, in production it should likely be npm run start


mparisi76
HOBBYOP

9 months ago

correct, however, there is no start script in the package.json


9 months ago

Did you not create one here?


mparisi76
HOBBYOP

9 months ago

I did and here are the logs:```Starting Container

npm warn config production Use --omit=dev instead.

vendor-panel@1.0.0 start

vite

VITE v5.4.19 ready in 558 ms

➜ Local: http://localhost:5173/

➜ Network: use --host to expose

➜ Inspect: http://localhost:5173/__inspect/

Error: spawn xdg-open ENOENT

at ChildProcess._handle.onexit (node:internal/child_process:285:19)

at onErrorNT (node:internal/child_process:483:16)

at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

npm error path /app

npm error command failed

npm error signal SIGTERM

npm error command sh -c vite

npm error A complete log of this run can be found in: /root/.npm/logs/2025-06-25T214123253Z-debug-0.log

Stopping Container```


9 months ago

Seems like the vite start command is expecting a /app directory. Please use the start command I suggested above


mparisi76
HOBBYOP

9 months ago

not sure I follow. you suggested npm run start which would run the start script ("vite") as seen in package.json


9 months ago

Apologies, I'm not too familiar with vite. I've done some Googling and here's what I've found.

Vite should not be used in production as it's optimized for development. Instead, you should npm run build and serve from the resulting distribution with caddy


mparisi76
HOBBYOP

9 months ago

yes, that all sounds right. "vite build" is used to generate a production build


mparisi76
HOBBYOP

9 months ago

the problem I'm having is the deployment part


9 months ago

Set your start command to caddy run and see what happens


mparisi76
HOBBYOP

9 months ago

I thought Railway automatically serves the dist folder from "vite build"


mparisi76
HOBBYOP

9 months ago

ok, let me try that


9 months ago

It doesn't. Seems like Railpack's Vite detection isn't fantastic


9 months ago

It would help greatly if the source repo had a proper start command. Railway would likely be able to work with that. Because it's missing, Railway doesn't know what to do


mparisi76
HOBBYOP

9 months ago

yea, that's kind of what I gathered also


mparisi76
HOBBYOP

9 months ago

I think Railway will use Caddy if the conditions are right.. I am trying to follow this thread - https://discord.com/channels/713503345364697088/1386788139649073223


mparisi76
HOBBYOP

9 months ago

which basically says I don't need a start script


mparisi76
HOBBYOP

9 months ago

So the deployment succeeds now and it seems caddy is running, but when I visit the site, I get Bad Gateway


mparisi76
HOBBYOP

9 months ago

1387578531118321700


9 months ago

Any errors in the logs?


mparisi76
HOBBYOP

9 months ago

I finally got this working. It turns out I had to install Caddy package, remove start script, remove Dockerfile and change build script to "vite build"


mparisi76
HOBBYOP

9 months ago

and then change port to 8080 on my domains


mparisi76
HOBBYOP

9 months ago

Thanks for your help!


9 months ago

Great! Port was the next thing to check. Glad to hear you got it all working


9 months ago

!s


Status changed to Solved adam 9 months ago


Loading...