meshmonitor icon indicating copy to clipboard operation
meshmonitor copied to clipboard

[BUG] 3.8.1 - Raspbian baremetal - Node 25

Open kokoshell opened this issue 8 months ago • 24 comments

Browser cant connect to Meshmonitor on 5173 ...

Image

kokoshell avatar Mar 06 '26 11:03 kokoshell

What happens when you try? 404? White page? No connection?

If it's a while page (which I think that's what you're showing me), you need to set the ALLOWED_ORIGINS

Yeraze avatar Mar 06 '26 13:03 Yeraze

Yes white page, ALLOWED_ORIGINS is properly set for loongtime ago!

kokoshell avatar Mar 06 '26 13:03 kokoshell

Can you attach the startup logs of the process?

Yeraze avatar Mar 06 '26 13:03 Yeraze

3.8.2 and still not working .... I suspect it might be because of PiVPN I have recently installed there ...?

kokoshell avatar Mar 07 '26 06:03 kokoshell

Can you attach startup logs of the process?

Yeraze avatar Mar 07 '26 13:03 Yeraze

Which startup logs ?? Where to find them ??

kokoshell avatar Mar 08 '26 06:03 kokoshell

3.8.3 and still dead ....

Image

kokoshell avatar Mar 08 '26 12:03 kokoshell

Which startup logs ?? Where to find them ??

Not sure, depends on how you're starting it. But there should be execution logs, maybe in syslog? journalctl? file on disk?

Yeraze avatar Mar 08 '26 12:03 Yeraze

A few things to help narrow this down — nothing in the 3.8 series changed the dev server or build pipeline, so this is likely an environment issue.

Can you provide:

  1. How are you starting MeshMonitor? The exact command (e.g. npm run dev, npm run dev:full, npm start, a systemd service, etc.)

  2. Can MeshMonitor reach itself locally? SSH into the Pi and run:

    curl http://localhost:5173
    

    If that returns HTML, the app is running but something is blocking external access.

  3. Check if PiVPN modified your firewall rules. PiVPN changes iptables which can block other ports:

    sudo iptables -L -n | head -30
    
  4. Startup logs. However you're starting MeshMonitor, the logs print to the terminal (stdout). If you're running it via systemd:

    sudo journalctl -u meshmonitor --no-pager -n 50
    

    Or if you run it manually, just copy/paste the terminal output after starting it.

The PiVPN install you mentioned is a likely culprit — it typically modifies iptables rules and could be blocking port 5173 from your browser.

Yeraze avatar Mar 08 '26 12:03 Yeraze

Image

kokoshell avatar Mar 08 '26 13:03 kokoshell

Image

kokoshell avatar Mar 08 '26 13:03 kokoshell

Image

kokoshell avatar Mar 08 '26 13:03 kokoshell

The screenshots are very helpful. Here's what I see:

  1. iptables is clean — PiVPN isn't blocking anything. Ruled out.
  2. curl works — The Vite dev server is serving HTML on port 5173 correctly.
  3. The HTML loads but the browser shows a white page.

The problem: You're running npm run dev:full which starts the Vite development server. This is intended for local development only — it serves raw .tsx source files that the browser compiles on-the-fly. This works on localhost but is fragile over the network and behind reverse proxies.

For a production/remote setup, you should be running the built version instead:

npm run build
npm start

This builds the app into optimized static files and serves everything on port 3001 (not 5173).

Update your systemd service to:

[Service]
Environment=ALLOWED_ORIGINS=http://192.168.3.77:3001,http://kokoshell.go.ro:80
ExecStart=/usr/bin/npm start
WorkingDirectory=/home/tester1/meshmonitor

Then run the build once before starting:

cd /home/tester1/meshmonitor
npm run build
npm run build:server
sudo systemctl restart meshmonitor

The app will then be available on port 3001 instead of 5173. Update your reverse proxy and ALLOWED_ORIGINS accordingly.

The white page is almost certainly because the Vite dev server's module loading (/@vite/client, /@react-refresh, raw .tsx imports) doesn't work reliably over a remote/proxied connection.

Yeraze avatar Mar 08 '26 14:03 Yeraze

npm run build

Image

kokoshell avatar Mar 08 '26 18:03 kokoshell

The build compiles cleanly on the current codebase, so this is likely a stale node_modules or mismatched Node.js version on your Pi.

Try a clean rebuild:

cd /home/tester1/meshmonitor
git pull
rm -rf node_modules
npm install
npm run build
npm run build:server

Also, what Node.js version are you running? Check with:

node --version

We require Node.js 18.x or newer. If you're on an older version, that could cause type errors from incompatible dependency versions.

Yeraze avatar Mar 09 '26 19:03 Yeraze

Image

kokoshell avatar Mar 09 '26 19:03 kokoshell

Image

kokoshell avatar Mar 09 '26 20:03 kokoshell

Same root cause — this is a type definition version mismatch in your node_modules, not a code bug. The build compiles cleanly on Node 18/20/22 with a fresh install.

Did you run the clean rebuild steps from my previous comment? Specifically the rm -rf node_modules && npm install part is critical — just npm install alone won't fix mismatched type versions.

cd /home/tester1/meshmonitor
git pull
rm -rf node_modules
npm install
npm run build
npm run build:server

Also please share the output of node --version so I can rule out a Node.js compatibility issue.

Yeraze avatar Mar 09 '26 20:03 Yeraze

That's the issue — Node.js v25.6.0 is an unstable/development release (odd-numbered versions are not meant for production). It ships with newer type definitions that cause these type mismatches.

Please switch to a stable LTS version (even-numbered). Node 22 is the current LTS:

# If using nvm:
nvm install 22
nvm use 22

# Or if installed via apt/package manager, use NodeSource:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs

Then do the clean rebuild:

cd /home/tester1/meshmonitor
rm -rf node_modules
npm install
npm run build
npm run build:server
npm start

That should resolve all the type errors.

Yeraze avatar Mar 09 '26 20:03 Yeraze

Hi Yeraze! Finally I was able to get 3.8.5 up & running with Node 22 on a fresh Raspbian install !! Thank you so much for all support ! The only thing which is not working yet for me is anonymous web access via extrenal IP (white page). DISABLE_ANLYMOUS=false (in .env file) Best regards, Kokoshell.

kokoshell avatar Mar 10 '26 12:03 kokoshell