-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Not adding optional module header results in 'undefined' as a header #1985
Comments
Yeah, seeing this too. Had to set |
i believe that's connected to #1897
did the same but the lines of header still persist :/ |
@sejka, in my case I'm using kweb a minimal kiosk browser. This did work as expected with a back level version of MM it's only started showing 'undefined' since the MM upgrade to 2.11.0. Hence raising the issue as it looks like a change in MM has introduced a regression defect. |
exactly, in #1897 i mentioned a commit i found to be problematic: d8b7292#diff-77ab163850ef0fa98d6a9ee9fb6bbcaf |
FWIW I was seeing this with Safari 13 on macOS. |
Sure, did you want to reopen #1897 or resolve the regression under this defect? |
I've submitted PR #1908 but as you can see in the discussion we haven't found clear solution. Maybe worth another look @MichMich? |
Looking for a solution as well, as I wanted to use MM to reuse my old tablet. Also open to contribute to a legacy-browser-friendly docker image |
Apparently the new (function (root, factory) {
if (typeof exports === "object") {
// add timestamps in front of log messages
require("console-stamp")(console, "yyyy-mm-dd HH:MM:ss.l");
// Node, CommonJS-like
module.exports = factory(root.config);
} else {
// Browser globals (root is window)
root.Log = factory(root.config);
}
})(this, function (config) {
let logLevel = {
info: Function.prototype.bind.call(console.info, console),
log: Function.prototype.bind.call(console.log, console),
error: Function.prototype.bind.call(console.error, console),
warn: Function.prototype.bind.call(console.warn, console),
group: Function.prototype.bind.call(console.group, console),
groupCollapsed: Function.prototype.bind.call(console.groupCollapsed, console),
groupEnd: Function.prototype.bind.call(console.groupEnd, console),
time: Function.prototype.bind.call(console.time, console),
timeEnd: Function.prototype.bind.call(console.timeEnd, console),
timeStamp: Function.prototype.bind.call(console.timeStamp, console)
};
logLevel.setLogLevel = function (newLevel) {
if (newLevel) {
Object.keys(logLevel).forEach(function (key, index) {
if (!newLevel.includes(key.toLocaleUpperCase())) {
logLevel[key] = function () {};
}
});
}
};
return logLevel;
}); |
As mentioned earlier, we don't officially support old browsers, but feel free to send a PR if you have a simple solution. |
I am trying to. The problem I am having is that the approach from @sejka worked with the last release but does not work with the new release because new issues for old browsers were introduced i.e. logger.js changes. I am aware that you don't want to add babel and/or webpack to your project, even though it would simplify keeping old browsers supported accross releases. |
we could add babel as a docker image step. I've tried it some time ago but couldn't set up babel so that before mentioned issues would be solved. (i don't think there's a polyfill for |
I also experimented around with a docker image that does the pre-compiling. Couldn't find a pre-compile solution for the HTML style element, but I believe we could resolve the style topic in here, if we can make logger.js work without too much hassle. For the docker image discussion, I think we could add it to the "official" docker image, see issue bastilimbach/docker-MagicMirror#47 |
I think it may be a question of identifying the module that is the offender and adding the |
I made a new PR for this issue, would really appreciate for some feedback in #2103 |
I still have it in the latest karsten13/magicmirror:latest docker environment when I don't specify the header. |
Problem
I just updated to v2.11.0 and modules that previously had no headers (as expected) are now displaying headers with the word 'undefined'.
Expected behavior
The module configuration says the header is an optional property. If this is not added then no header should be displayed.
The text was updated successfully, but these errors were encountered: