Read the statement by Michael Teeuw here.
MMM-Sunrise-Sunset
-
Uncaught ReferenceError: $ is not defined
at Class.updateSun (MMM-Sunrise-Sunset.js:33)
at Class.start (MMM-Sunrise-Sunset.js:12)
at startModules (loader.js:55)
at loader.js:40
at HTMLLinkElement.stylesheet.onload (loader.js:200) -
@pugsly said in MMM-Sunrise-Sunset:
Uncaught ReferenceError: $ is not defined
this module depends on jquery library being installed for this module, but its not…,
I am working on instructions for you… hang on
do
cd ~/MagicMirror/modules/MMM-Sunrise-Sunset npm install jquery # note the trailing dot (.) on the next line cp node_modules/jquery/dist/jquery.js .
then start your mirror again
-
@sdetweil said in MMM-Sunrise-Sunset:
cp node_modules/jquery/dist/jquery.js .
Slightly better, its displaying now but just says ‘Loading’
-
@pugsly ok, open the developers window again
this usually means that the api key is wrong … the api isn’t returning data
-
@sdetweil
Its not passing the API key in the HTML request.https://api.ipgeolocation.io/astronomy?apiKey=&lang=en&lat=39.2907&long=-75.6344 401
-
@pugsly said in MMM-Sunrise-Sunset:
apikey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
yep, case sensitive, it apiKey
-
@pugsly NVM… the K in apiKey is a capital. Its working now.
-
@sdetweil: Thank you so much for your help here. I’m having the exact same problem as @pugsly did, but unfortunately your suggestions seem to not do the trick. I was wondering if you could help me out, too. So far I got:
{ module: "MMM-Sunrise-Sunset", position: "bottom_bar", config: { apiKey: "xxx", latitude: "xx.03586", longitude: "xx.06379", timezone: "Europe/Berlin", layout: "inline" } },
My screen stays black, though, and the developer console is giving me this:
Uncaught ReferenceError: $ is not defined at Class.updateSun (MMM-Sunrise-Sunset.js:33) at Class.start (MMM-Sunrise-Sunset.js:12) at startModules (loader.js:55) at loader.js:40 at HTMLLinkElement.stylesheet.onload (loader.js:200)
I even tried executing your suggestions as root, thinking that I must’ve done something wrong, but I got the same error messages as before:
root@raspberrypi:/home/pi/MagicMirror/modules/MMM-Sunrise-Sunset# npm install jquery npm WARN saveError ENOENT: no such file or directory, open '/home/pi/MagicMirror/modules/package.json' npm WARN enoent ENOENT: no such file or directory, open '/home/pi/MagicMirror/modules/package.json' npm WARN modules No description npm WARN modules No repository field. npm WARN modules No README data npm WARN modules No license field. + jquery@3.4.1 removed 1 package, updated 1 package and audited 1 package in 4.09s found 0 vulnerabilities root@raspberrypi:/home/pi/MagicMirror/modules/MMM-Sunrise-Sunset# cp node/modules/jquery/dist/jquery.js . cp: cannot stat 'node/modules/jquery/dist/jquery.js': No such file or directory
What am I missing here?
-
@dankerthrone said in MMM-Sunrise-Sunset:
Uncaught ReferenceError: $ is not defined
cp node/modules/jquery/dist/jquery.js .
should be (notice the underscore, _ instead of the slash /)
cp node_modules/jquery/dist/jquery.js .
-
That seems to have been a copy/paste-error. My terminal history shows it with the underscore. To make sure, I tried it once again, but still get
pi@raspberrypi:~/MagicMirror/modules/MMM-Sunrise-Sunset $ cp node_modules/jquery/dist/jquery.js . cp: cannot stat 'node_modules/jquery/dist/jquery.js': No such file or directory