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

mparisi76
HOBBY

2 days 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

0 Replies

mparisi76
HOBBY

2 days ago

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


2 days 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
HOBBY

2 days 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?


2 days 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
HOBBY

2 days 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
HOBBY

2 days ago

Thank you


2 days ago

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


mparisi76
HOBBY

2 days ago

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


mparisi76
HOBBY

2 days ago

it runs without any changes on vercel..


mparisi76
HOBBY

2 days ago

so there is no problem with the application


2 days ago

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


2 days ago

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


2 days 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
HOBBY

2 days 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
HOBBY

2 days ago

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


mparisi76
HOBBY

2 days ago

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


2 days ago

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


2 days ago

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


mparisi76
HOBBY

2 days ago

running locally is just npm run dev


mparisi76
HOBBY

2 days ago

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


2 days ago

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


mparisi76
HOBBY

2 days ago

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


2 days ago

Did you not create one here?


mparisi76
HOBBY

2 days 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```


2 days ago

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


mparisi76
HOBBY

2 days ago

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


2 days 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
HOBBY

2 days ago

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


mparisi76
HOBBY

2 days ago

the problem I'm having is the deployment part


2 days ago

Set your start command to caddy run and see what happens


mparisi76
HOBBY

2 days ago

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


mparisi76
HOBBY

2 days ago

ok, let me try that


2 days ago

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


2 days 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
HOBBY

2 days ago

yea, that's kind of what I gathered also


mparisi76
HOBBY

2 days 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
HOBBY

2 days ago

which basically says I don't need a start script


mparisi76
HOBBY

2 days ago

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


mparisi76
HOBBY

2 days ago

1387578531118321700


2 days ago

Any errors in the logs?


mparisi76
HOBBY

2 days 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
HOBBY

2 days ago

and then change port to 8080 on my domains


mparisi76
HOBBY

2 days ago

Thanks for your help!


2 days ago

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


2 days ago

!s


Status changed to Solved adam 2 days ago


I had my app up and running in 5 minutes with Vercel - Railway Help Station