Closed 68267a closed 3 years ago
I used numbers 1
and 2
instead of main
and pageTwo
. It loaded with a title of 'undefined', but didn't actually rotate pages.
modules started!
TypeError: str.toLowerCase is not a function
at Class.titleCase (MMM-Page-Selector.js:347)
at Class.getDom (MMM-Page-Selector.js:68)
at main.js:114
at new Promise (<anonymous>)
at updateDom (main.js:113)
at main.js:53
at Array.forEach (<anonymous>)
at createDomObjects (main.js:20)
at Object.modulesStarted (main.js:511)
at startModules (loader.js:56)
Promise.catch (async)
(anonymous) @ main.js:59
createDomObjects @ main.js:20
modulesStarted @ main.js:511
startModules @ loader.js:56
(anonymous) @ loader.js:38
stylesheet.onload @ loader.js:202
load (async)
loadFile @ loader.js:200
loadNextModule @ loader.js:36
(anonymous) @ loader.js:29
(anonymous) @ loader.js:123
(anonymous) @ loader.js:159
loadTranslations @ module.js:339
(anonymous) @ loader.js:156
loadNextDependency @ module.js:302
(anonymous) @ module.js:299
stylesheet.onload @ loader.js:202
load (async)
loadFile @ loader.js:200
loadFile @ loader.js:260
loadNextDependency @ module.js:297
loadDependencies @ module.js:306
loadStyles @ module.js:272
(anonymous) @ loader.js:154
loadNextDependency @ module.js:302
(anonymous) @ module.js:299
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadFile @ loader.js:245
loadNextDependency @ module.js:297
loadDependencies @ module.js:306
loadScripts @ module.js:281
bootstrapModule @ loader.js:152
afterLoad @ loader.js:122
(anonymous) @ loader.js:135
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadModule @ loader.js:133
loadNextModule @ loader.js:27
(anonymous) @ loader.js:29
(anonymous) @ loader.js:123
(anonymous) @ loader.js:159
loadTranslations @ module.js:339
(anonymous) @ loader.js:156
loadNextDependency @ module.js:302
(anonymous) @ module.js:299
stylesheet.onload @ loader.js:202
load (async)
loadFile @ loader.js:200
loadFile @ loader.js:260
loadNextDependency @ module.js:297
loadDependencies @ module.js:306
loadStyles @ module.js:272
(anonymous) @ loader.js:154
loadNextDependency @ module.js:302
(anonymous) @ module.js:299
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadFile @ loader.js:253
loadNextDependency @ module.js:297
(anonymous) @ module.js:299
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadFile @ loader.js:253
loadNextDependency @ module.js:297
(anonymous) @ module.js:299
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadFile @ loader.js:253
loadNextDependency @ module.js:297
loadDependencies @ module.js:306
loadScripts @ module.js:281
bootstrapModule @ loader.js:152
afterLoad @ loader.js:122
(anonymous) @ loader.js:135
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadModule @ loader.js:133
loadNextModule @ loader.js:27
loadModules @ loader.js:43
loadModules @ loader.js:223
init @ main.js:493
(anonymous) @ main.js:619
MMM-Page-Selector.js:347 Uncaught (in promise) TypeError: str.toLowerCase is not a function
at Class.titleCase (MMM-Page-Selector.js:347)
at Class.getDom (MMM-Page-Selector.js:68)
at main.js:114
at new Promise (<anonymous>)
at updateDom (main.js:113)
at main.js:53
at Array.forEach (<anonymous>)
at createDomObjects (main.js:20)
at Object.modulesStarted (main.js:511)
at startModules (loader.js:56)
titleCase @ MMM-Page-Selector.js:347
getDom @ MMM-Page-Selector.js:68
(anonymous) @ main.js:114
updateDom @ main.js:113
(anonymous) @ main.js:53
createDomObjects @ main.js:20
modulesStarted @ main.js:511
startModules @ loader.js:56
(anonymous) @ loader.js:38
stylesheet.onload @ loader.js:202
Promise.then (async)
createDomObjects @ main.js:64
modulesStarted @ main.js:511
startModules @ loader.js:56
(anonymous) @ loader.js:38
stylesheet.onload @ loader.js:202
load (async)
loadFile @ loader.js:200
loadNextModule @ loader.js:36
(anonymous) @ loader.js:29
(anonymous) @ loader.js:123
(anonymous) @ loader.js:159
loadTranslations @ module.js:339
(anonymous) @ loader.js:156
loadNextDependency @ module.js:302
(anonymous) @ module.js:299
stylesheet.onload @ loader.js:202
load (async)
loadFile @ loader.js:200
loadFile @ loader.js:260
loadNextDependency @ module.js:297
loadDependencies @ module.js:306
loadStyles @ module.js:272
(anonymous) @ loader.js:154
loadNextDependency @ module.js:302
(anonymous) @ module.js:299
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadFile @ loader.js:245
loadNextDependency @ module.js:297
loadDependencies @ module.js:306
loadScripts @ module.js:281
bootstrapModule @ loader.js:152
afterLoad @ loader.js:122
(anonymous) @ loader.js:135
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadModule @ loader.js:133
loadNextModule @ loader.js:27
(anonymous) @ loader.js:29
(anonymous) @ loader.js:123
(anonymous) @ loader.js:159
loadTranslations @ module.js:339
(anonymous) @ loader.js:156
loadNextDependency @ module.js:302
(anonymous) @ module.js:299
stylesheet.onload @ loader.js:202
load (async)
loadFile @ loader.js:200
loadFile @ loader.js:260
loadNextDependency @ module.js:297
loadDependencies @ module.js:306
loadStyles @ module.js:272
(anonymous) @ loader.js:154
loadNextDependency @ module.js:302
(anonymous) @ module.js:299
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadFile @ loader.js:253
loadNextDependency @ module.js:297
(anonymous) @ module.js:299
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadFile @ loader.js:253
loadNextDependency @ module.js:297
(anonymous) @ module.js:299
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadFile @ loader.js:253
loadNextDependency @ module.js:297
loadDependencies @ module.js:306
loadScripts @ module.js:281
bootstrapModule @ loader.js:152
afterLoad @ loader.js:122
(anonymous) @ loader.js:135
script.onload @ loader.js:182
load (async)
loadFile @ loader.js:180
loadModule @ loader.js:133
loadNextModule @ loader.js:27
loadModules @ loader.js:43
loadModules @ loader.js:223
init @ main.js:493
(anonymous) @ main.js:619
4MMM-Page-Selector.js:217 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Class.changePage (MMM-Page-Selector.js:217)
at MMM-Page-Selector.js:47
I'm a sysadmin with some bash experience. I don't know anthing about javascript or git so I'm just posting what I find as I find it because the other page modules aren't as nice as this one.
In the debug
function, replace console.log(message)
with console.debug(message)
. Makes it easier to see in the log.
Give me a bit to set up an environment for this. It's been a while since I worked with magic mirror so I don't remember exactly how the module works.
Are you using anything special like pm2 to run the mirror?
pretty sure the only thing I'm doing special is node serveronly
and I'm streaming it to a chromecast.
What hardware are you running the server on? I did a fresh install, copied your module config, and it worked perfectly.
The error you are having seems to imply the pages
object is undefined. This could be because the only page you use if all
which does not add a page to the pagelist. Setting defaultPage
as you do should add a page, but I would suggest changing the line pages: {"all": "top_left"}
to pages: {"main": "top_left"}
.
It's a debian VM. I've used every combination of page number, string, quoted, unquoted, etc I can think of.
I'm trying to add a bunch of debugging but I don't know javascript well enough.
I pushed a commit that should solve your initial problem. The page names have to be strings. Quoting or unquoting does not change how javascript represents the object so that wouldn't matter.
No change. Reinstalling from scratch.
Did you get the exact same error? This one: Uncaught TypeError: Cannot convert undefined or null to object
?
edit: that was unrelated. I already wiped the config. I'll update if I can't get it to work.
edit: mmpm doesn't install MM, just modules.
/* Magic Mirror Config Sample
*
* By Michael Teeuw https://michaelteeuw.nl
* MIT Licensed.
*
* For more information on how you can configure this file
* See https://github.com/MichMich/MagicMirror#configuration
*
*/
var config = {
address: "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 or empty, is "localhost"
port: 8080,
basePath: "/", // The URL path where MagicMirror is hosted. If you are using a Reverse proxy
// you must set the sub path here. basePath must end with a /
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // 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"],
useHttps: false, // Support HTTPS or not, default "false" will use HTTP
httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true
httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true
language: "en",
logLevel: ["INFO", "LOG", "WARN", "ERROR"],
timeFormat: 24,
units: "metric",
// serverOnly: true/false/"local" ,
// local for armv6l processors, default
// starts serveronly and then starts chrome browser
// false, default for all NON-armv6l devices
// true, force serveronly mode, because you want to.. no UI on this device
modules: [
{
module: "MMM-Page-Selector",
position: "top_center",
config: {
defaultPage: "main",
displayTitle: true,
selectPageNotif: ["SELECT_PAGE"],
incrementPageNotif: ["PAGE_UP"],
decrementPageNotif: ["PAGE_DOWN"],
persistentPages: true,
debug: true,
autoChange: {
interval: 10
}
}
},
{
module: "clock",
pages: {"all": "top_left"}
//position: "top_left"
}
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}
Confirmed, the install was bad.
Config as simple as I can possibly get it, just shows a blank screen.
Works fine if I comment out the module and uncomment the
position
tag. Here's the console log, error doesn't appear until after the 10 second timer:debug
doesn't seem to do anything.