meteordeployment

How to run a meteor 3 app on custom server


I've built a simple app using meteor3 + vue that runs properly locally using meteor npm run start

anyway now I'm trying to deploy and run it on my private server; and when I try to load the page I get this error in chrome console:

Uncaught Error: Cannot find module './../../../../../home/ck/repositories/test/meteor-test-app/_vite-bundle/client/meteor-entry.js._vite-bundle.tmp'

the steps I did to deploy:

meteor build ../builds

then used rsync to move the meteor-test-app.tar.gz bundle on the server

on the server:

tar -xzvf meteor-test-app.tar.gz

cd bundle

cat .node_version.txt (it says 22.16.0)

nvm use 22.16.0

cd programs/server npm install

cd ..

MONGO_URL=... ROOT_URL=... PORT=7800 node main.js


Solution

  • if this can be of some help, in my case the problem was due to the fact that the app was inside a folder on another partition, symlinked in my home; so accessing the app's folder by terminal using the symlink (so cd ~/repositories/app) and running it, causes meteor-vite to build that path it needs for auto imports in the wrong way;

    accessing the app using the real path (so cd /partition_name/repositories/app) and running it from there, makes it works properly.