Read the statement by Michael Teeuw here.
Cannot find module '#server_functions'
-
#server_functionsis an alias forjs/server_functions.jswhich is defined inpackage.json:"imports": { "#module_functions": { "default": "./js/module_functions.js" }, "#server_functions": { "default": "./js/server_functions.js" } },Because axios is the only diff your
package.jsonshould contain above lines.I have no idea anymore (maybe corrupt sd card).
-
@chrisfr1976 can you do
Stop MagicMirror
cd -/MagicMirror rm -rf node_modules npm installStart MagicMirror
npm startAlso, can you send me the
~/MagicMirror/installers/upgrade.logMy email is same user id as here, at gmail
-
I don’t see that error in my test of npm run server.
-
@sdetweil and @karsten13, I think I solved my problem.
In the beginning when I used the update script it stopped with the node-version but didn’t update. So I updated manually by using the original code from Node JS. So I installed node v22.20.0. Later I went again down to v22.18.0. Maybe this caused some trouble. But Maybe not.rm -rf node_modulesandnpm installI did already 3 times before.But now I modified the
calendarfetcher.jsandnewsfeedfetcher.js:This was removed:
const { getUserAgent } = require("#server_functions"); const { scheduleTimer } = require("#module_functions");and replaced by this:
const getUserAgent = () => "MagicMirror v2.33.0"; const scheduleTimer = (timerRef, interval, callback) => { clearTimeout(timerRef); return setTimeout(callback, interval); };No errors and Calendar/Newsfeed is displayed as before. I don’t know exactly if there are any new issues now but so far I’m happy.
-
@chrisfr1976 I’d really like to see the upgrade.log file
~/MagicMirror/installers/upgrade.logEmail to Me , same userid as here at gmail
-
@sdetweil Hey, no problem generally but I‘m out until Thursday. I‘ll send it then.
-
@chrisfr1976 when you have time
-
Hi Sam,
After the update to MagicMirror v2.34.0 I had again thisCannot find module '#server_functionsissue. See above.
I solved it again manually in thecalendarfetcher.jsandnewsfeedfetcher.jswith a relative path.I replaced this:
const { getUserAgent } = require("#server_functions"); const { scheduleTimer } = require("#module_functions"); //only in newsfeedwith
const { getUserAgent } = require("../../../js/server_functions"); const { scheduleTimer } = require("../../../js/module_functions"); //only in newsfeedThis time your update script worked fine without any error.
Maybe I’m alone with this behavior, but now everything works fine again as before the update. If anyone else discovers this problem, the code above might help.
-
…and I’ll remove axios from my modules. This is causing this trouble.
-
@chrisfr1976 but that means you dont have the correct node version or dependencies
Down level npm, see imports in package.json

