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
Project ID:
6bd21780-3c86-4d47-a6e4-0941c3c2bbf1
6bd21780-3c86-4d47-a6e4-0941c3c2bbf1
I’m up and running - needed to add $PORT to expose it in the package.json 👍
can you show me what the
serve
command runs?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
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 railwayFair enough. Any recommendations on something more production capable?
depends, is this a single page app? (single index.html file in
dist
)It is indeed
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