-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not validate main module js file. ReferenceError: window is not defined #18
Comments
same error here. |
Hi, here is the MMM-RAIN-MAP part in my config.js :
//-----BOTTOM-CENTER------------------------------------------------------------------
{
module: "MMM-RAIN-MAP",
position: "bottom_center",
config: {
animationSpeed: 600,
displayClockSymbol: true,
timeFormat: 24,
displayTime: true,
extraDelayLastFrame: 10000,
mapHeight: "1000px",
mapWidth: "1000px",
mapPositions: [
{ lat: "49.945339", lng: "8.454780", zoom: 13, loops: 3},
{ lat: "49.945339", lng: "8.454780", zoom: 10, loops: 3},
{ lat: "49.945339", lng: "8.454780", zoom: 7, loops: 3},
{ lat: "49.945339", lng: "8.454780", zoom: 4, loops: 3}
],
markers: [
{ lat: "49.945339", lng: "8.454780", color: "red" }
],
onlyOnRain: false,
opacity: 0.8,
updateIntervalInSeconds: 600,
zoom: 10,
zoomOutEach: 2,
zoomOutLevel: 2
}
},
I hope this helps, good luck,
Michael
… On 29. Aug 2021, at 14:38, Jan ***@***.***> wrote:
@PH1TCH <https://github.com/PH1TCH> @mfehse <https://github.com/mfehse>
I still can not reproduce that. Can you please provide me your complete config.js?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#18 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA6QYJLMZ5YBC4QBP7GIDI3T7IS3BANCNFSM5DAFQMDQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi @mfehse Michael, Can you please check if you use the latest module version? (by executing
If you're already using that version or an update doesn't work, please list all modules that you have installed. |
Hi,
Sorry, same error message. But ist shows the rain-map. I could unobfuscate the js and find the statement, shall I?
Cheers, Michael
The error message is:
[30.08.2021 21:17.12.978] [ERROR] ERROR! Could not validate main module js file.
[30.08.2021 21:17.12.982] [ERROR] ReferenceError: window is not defined
at /home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:1913
at Object.243 (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:142305)
at e (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:151189)
at Object.138 (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:142720)
at e (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:151189)
at /home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:151230
at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:151237)
at Module._compile (internal/modules/cjs/loader.js:1152:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
at Module.load (internal/modules/cjs/loader.js:992:32)
The modules I use are:
FlightTracker
MMM-Currency
MMM-DWD-Pollen
MMM-DWD-WarnWeather
MMM-DarkSkyForecast
MMM-RAIN-MAP
MMM-Remote-Control
MMM-iFrame
worldclock
Plus some from default.
The config.js is:
var config = {
address: "0.0.0.0",
// "localhost", // Address to listen on, can be:
// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
// - another specific IPv4/6 to listen on a specific interface
// - "", "0.0.0.0", "::" to listen on any interface
// Default, when address config is left out, is "localhost"
port: 8080,
ipWhitelist: [],
//["127.0.0.1", "::ffff:127.0.0.1", "::1", "192.168.1.1/24"], // Set [] to allow all IP addresses
// or add a specific IPv4 of 192.168.1.5 :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
language: "en",
timeFormat: 24,
units: "metric",
modules: [
//-----OVERALL-------------------------------------------------------------------
{
module: "alert",
},
{
module: "updatenotification",
position: "top_bar"
},
//-----TOP-LEFT-------------------------------------------------------------------
{
module: "clock",
position: "top_left"
},
{
module: "worldclock",
position: "top_left",
config: {
timeformat: "hh:mm",
style: "left",
offsetTimezone: "Europe/Berlin",
clocks: [
{
title: "SFO",
timezone: "America/Los_Angeles"
},
{
title: "Shenzhen",
timezone: "Asia/Shanghai"
}
]
}
},
{
module: "calendar",
header: "Holidays",
position: "top_left",
config: {
fetchInterval: "86400000",
fadePoint: 0.5,
calendars: [
{
symbol: "calendar-alt",
url: "https://www.ferienwiki.de/exports/feiertage/2021/de",
maximumNumberOfDays: "61"
},
{
symbol: "calendar-day",
url: "https://www.ferienwiki.de/exports/ferien/2021/de/hessen",
maximumNumberOfDays: "90"
}
]
}
},
//-----BOTTOM-CENTER------------------------------------------------------------------
{
module: "MMM-RAIN-MAP",
position: "bottom_center",
config: {
animationSpeed: 600,
displayClockSymbol: true,
timeFormat: 24,
displayTime: true,
extraDelayLastFrame: 10000,
mapHeight: "1000px",
mapWidth: "1000px",
mapPositions: [
{ lat: "49.945339", lng: "8.454780", zoom: 13, loops: 3},
{ lat: "49.945339", lng: "8.454780", zoom: 10, loops: 3},
{ lat: "49.945339", lng: "8.454780", zoom: 7, loops: 3},
{ lat: "49.945339", lng: "8.454780", zoom: 4, loops: 3}
],
markers: [
{ lat: "49.945339", lng: "8.454780", color: "red" }
],
onlyOnRain: false,
opacity: 0.8,
updateIntervalInSeconds: 600,
zoom: 10,
zoomOutEach: 2,
zoomOutLevel: 2
}
},
//-----BOTTOM-LEFT-------------------------------------------------------------------
{
module: 'MMM-Remote-Control',
position: 'bottom_left',
config: {
customCommand: {}, // Optional, See "Using Custom Commands" below
customMenu: "custom_menu.json", // Optional, See "Custom Menu Items" below
showModuleApiMenu: true // Optional, Enable the Module Controls menu
}
},
{
module: "MMM-DarkSkyForecast",
position: "bottom_left",
header: "Nauheim",
config: {
apikey: “XXXX",
latitude: "49.945339",
longitude: "8.454780",
concise: "false",
units: "si"
}
},
//-----TOP-CENTER-------------------------------------------------------------------
{
module: "MMM-DWD-Pollen",
position: "top_center",
header: "Pollenwarnung",
config: {
updateInterval: 1 * 60 * 60 * 1000, // every 1 hour
DWD_region: 92, // Rhein Main
icon: true // Show icons or not
}
},
{
module: 'MMM-DWD-WarnWeather',
position: 'top_center',
header: 'Warnwetter',
config: {
region: 'Nauheim',
changeColor: true,
minutes: false,
displayRegionName: false,
displayInnerHeader: false,
interval: 15 * 60 * 1000, // every 10 minutes
loadingText: 'Warnungen werden geladen...',
noWarningText: 'Keine Warnungen',
severityThreshold: 1
}
}, //-----TOP-RIGHT--------------------------------------------------------------------
{
module: 'FlightTracker',
header: 'Nearby planes',
position: 'top_right',
config: {
updateInterval: 120,
limit: -1, // max numberof planes to show
speedUnits: 'metric',
altitudeUnits: 'metric',
centerPoint: [49.945339, 8.454780],
distance: 13, // radius of box in km
noPlanesLabel: "Alles frei in alle Richtungen",
passingByThreshold: 2000, // height of box to watch
showOnlyBox: true, // show planes in box
boxLabel: "in Box",
showOnlyPassing: false, // show planes above box
passingLabel: "passing",
showOnlyALL: true, // show all planes if box height not set
allLabel: "others",
showOnlyTo: "FRA", // show planes with destination here
toLabel: "to FRA",
showOnlyFrom: "FRA", // show planes with origin here
fromLabel: "from FRA"
}
},
{
module: 'MMM-iFrame',
position: 'top_right', // This can be any of the regions.
config: {
// Johns Hopkins COVID page mobile version
url: ["https://www.arcgis.com/apps/opsdashboard/index.html#/85320e2ea5424dfaaa75ae62e5c06e61"],
width: "400",
height: "600",
frameWidth: "400",
updateInterval: 4 * 60* 60 * 1000 // once per 4 hours
}
}, //-----BOTTOM-RIGHT--------------------------------------------------------------------
{
module: 'MMM-Currency',
position: 'bottom_right',
config: {
accessKey: “XXX", // Free account & API Access Key at currencylayer.com
source: "USD", // USD unless you upgrade from free account
convert2first: true, // convert to basis equals first of symbols (USD is always basis for free account)
symbols: "EUR,CHF,GBP,CNY,USD", // Currency symbols
useHeader: true,
header: "Wechselkurse",
maxWidth: "300px",
}
}
]
//--------------------------------------------------------------------------------------------
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}
|
@mfehse thanks. The problem comes from MMM-Remote-Control. Please open a ticket there. Or safely ignore it. |
Jopyth/MMM-Remote-Control#267 Just to clarify, this issue comes from a bad handling of Javascript files from Remote Control. However, this does not represent a problem because Remote Control just try to load all those files. You can still use both modules and safely ignore this error. Will be fixed in the next update. |
Thank you. Keep up the good work
… On 30. Aug 2021, at 21:48, Jan ***@***.***> wrote:
@mfehse <https://github.com/mfehse> thanks.
The problem comes from MMM-Remote-Control.
I'll open a ticket there
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#18 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA6QYJIXSRAC7TABWDFP4LTT7PN73ANCNFSM5DAFQMDQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hello and thank you for opening an issue.
I found a bug in this module
Please make sure to only submit reproducible issues.
When submitting a new issue, please supply the following information:
Platform: Place your platform here... give us your web browser/Electron version and your hardware (Raspberry Pi 2/3/4, Windows, Mac, Linux, System V UNIX).
Raspberry Pi 4, Electron 13.2.3
Node Version: Make sure it's version 10 or later.
Node 14.17.5
MagicMirror Version: Please let us now which version of MagicMirror you are running. It can be found in the
package.log
file.MM 2.16.0
Description: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem.
Error shows up in the logs with "pm2 logs"
0|mm | [29.08.2021 13:07.10.633] [ERROR] ERROR! Could not validate main module js file. 0|mm | [29.08.2021 13:07.10.638] [ERROR] ReferenceError: window is not defined 0|mm | at /home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:1913 0|mm | at Object.243 (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:142305) 0|mm | at e (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:151019) 0|mm | at Object.138 (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:142720) 0|mm | at e (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:151019) 0|mm | at /home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:151060 0|mm | at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:1:151067) 0|mm | at Module._compile (internal/modules/cjs/loader.js:1078:30) 0|mm | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10) 0|mm | at Module.load (internal/modules/cjs/loader.js:935:32)
Configuration: What does the used config.js file look like? Don't forget to remove any sensitive information!
{ module: "MMM-RAIN-MAP", position: "top_right", config: { animationSpeedMs: 1200, defaultZoomLevel: 8, displayTime: true, displayClockSymbol: false, displayTimeline: false, displayOnlyOnRain: true, extraDelayLastFrameMs: 2000, markers: [ { lat: xxx, lng: xxx, color: "grey" } ], mapPositions: [ { lat: xxx, lng: xxx, zoom: 5, loops: 5 }, { lat: xxx, lng: xxx, zoom: 10, loops: 5 } ], mapUrl: "https://tile.jawg.io/e748bbb4-161f-4441-9612-74be9f3b7313/{z}/{x}/{y}.png?access-token=xxxxxx&lang=de&raster=false", mapHeight: "300px", mapWidth: "400px", updateIntervalInSeconds: 300, } },
Additional Notes: Provide any other relevant notes not previously mentioned. This is optional.
Currently the module does not show / hide itself reliably in my case based on precipitation status of MMM-OpenWeatherForecast
The text was updated successfully, but these errors were encountered: