apotdevin / thunderhub

ThunderHub LND Lightning Node Manager in your Browser
https://www.thunderhub.io/
MIT License
412 stars 84 forks source link

After login, nothing happens (thunderhub shows login page again). Error on server, but only when run in background. #581

Open kkoenen opened 10 months ago

kkoenen commented 10 months ago

Describe the problem/bug Thunderhub works as expected, when started using "npm start" or "npm run start". But when starting the same command from a service (/etc/systemd/system/thunderhub.service), the application doesn't work (after login, same login screen is presented). Server shows error below.

Oct 29 16:54:17 toby-nuc npm[25743]: ReferenceError: window is not defined
Oct 29 16:54:17 toby-nuc npm[25743]:     at /home/*****/thunderhub/src/client/.next/server/chunks/1010.js:14:70826
Oct 29 16:54:17 toby-nuc npm[25743]:     at Object.75015 (/home/*****/thunderhub/src/client/.next/server/chunks/1010.js:14:71234)
Oct 29 16:54:17 toby-nuc npm[25743]:     at __webpack_require__ (/home/*****/thunderhub/src/client/.next/server/webpack-runtime.js:1:145)
Oct 29 16:54:17 toby-nuc npm[25743]:     at Object.79577 (/home/*****/thunderhub/src/client/.next/server/chunks/1010.js:1:426143)
Oct 29 16:54:17 toby-nuc npm[25743]:     at __webpack_require__ (/home/*****/thunderhub/src/client/.next/server/webpack-runtime.js:1:145)
Oct 29 16:54:17 toby-nuc npm[25743]:     at Object.20175 (/home/*****/thunderhub/src/client/.next/server/chunks/1010.js:1:327766)
Oct 29 16:54:17 toby-nuc npm[25743]:     at __webpack_require__ (/home/*****/thunderhub/src/client/.next/server/webpack-runtime.js:1:145)
Oct 29 16:54:17 toby-nuc npm[25743]:     at Object.83654 (/home/*****/thunderhub/src/client/.next/server/chunks/1010.js:1:337077)
Oct 29 16:54:17 toby-nuc npm[25743]:     at __webpack_require__ (/home/*****/thunderhub/src/client/.next/server/webpack-runtime.js:1:145)
Oct 29 16:54:17 toby-nuc npm[25743]:     at Object.99357 (/home/*****/thunderhub/src/client/.next/server/chunks/1010.js:1:357338)

Your environment

To Reproduce Steps to reproduce the behavior: start thunderhub by using systemd. login. error.

.service file:

[Unit]
Description=Thunderhub
Wants=lnd.service
After=lnd.service

[Service]
User=*****
WorkingDirectory=/home/*****/thunderhub
ExecStart=/usr/bin/npm run start
Restart=on-failure
TimeoutSec=120
RestartSec=30

[Install]
WantedBy=multi-user.target

Expected behavior Normal operation of thunderhub.

Actual behavior After login, server shows "ReferenceError: window is not defined" error and UI shows login-screen.

kkoenen commented 10 months ago

After trying different versions of npm and node, no fix. So I decided to move back to Thunderhub v0.13.20 :disappointed: