Trying to deploy a Vite/Vue2 App

Hi all. I’m trying to deploy a service from GitHub that’s a Vue.js app built vía create-vue. Running through the nixpack gets it to the deploy step. I’ve provided the start command npm run serve and I’m getting errors saying it can’t find the serve command. I’m guessing I’m not in the right directory potentially, or I’m providing the completely wrong command. Anyone got any experience and can lend a hand here?
9 Replies
Percy
Percy13mo ago
Project ID: 6bd21780-3c86-4d47-a6e4-0941c3c2bbf1
josh_____d
josh_____d13mo ago
6bd21780-3c86-4d47-a6e4-0941c3c2bbf1 I’m up and running - needed to add $PORT to expose it in the package.json 👍
Brody
Brody13mo ago
can you show me what the serve command runs?
josh_____d
josh_____d13mo ago
I can - "serve": "vite --host 0.0.0.0 --port $PORT" As I say, all working now, just needed to add that to package.json
Brody
Brody13mo ago
it works but that is not a good idea in the slightest the command vite starts a development server, you really don't want to be running a development server on railway
josh_____d
josh_____d13mo ago
Fair enough. Any recommendations on something more production capable?
Brody
Brody13mo ago
depends, is this a single page app? (single index.html file in dist)
josh_____d
josh_____d13mo ago
It is indeed
Brody
Brody13mo ago
https://help.railway.app/project-help/f9v3gkPQRy4UShk5SnoPDH/getting-your-create-react-app-running-on-railway/qHRsgxa5n57xLp1yVgk9fP page is a little broken, for vite you substitute build for dist in the new start command