Skip to content
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

Language default of 'en' in config.js results in a blank screen #388

Closed
causztic opened this issue Aug 1, 2016 · 34 comments
Closed

Language default of 'en' in config.js results in a blank screen #388

causztic opened this issue Aug 1, 2016 · 34 comments

Comments

@causztic
Copy link

causztic commented Aug 1, 2016

Hello,

I've experienced what other users have encountered over here https://forum.magicmirror.builders/topic/412/blank-black-screen-noob/18

Basically having the option of 'en' (which is the default in the config.js.sample) results in a blank screen. An empty string defaults it properly to English and works. Other language options works too.

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

Thanks for reporting. I'll investigate on the forum what is causing this issue. As soon as Its certain that this is a bug, I'll continue in this github issue.

@MrHarcombe
Copy link

FWIW, I'm helping my son try and get this working (with a voice control module, by @dr4ke616) and we hit similar problems... but it's only for modules which use the translations part of the system - for us, initially, we just removed the default "alert" module and all seemed to be working (but any third party module that used the transations, caused the system to fail).

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

Interesting. I'll look into that.

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

@MrHarcombe is there a particular module you were using that caused the issues?

@MrHarcombe
Copy link

As I say, the default "alert" module made things stop working. Having a default language of 'en' worked with the other default modules.... but I think "alert" is the only one that uses translations, isn't it?

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

I tried it with the alert module and the en language setting, and it seems to work fine here. Do you see any particular error in the developer tools console panel?

@MrHarcombe
Copy link

MrHarcombe commented Aug 1, 2016

The following config fails giving this browser console log, whereas the same config but with an empty string instead of en gives this console log.

/* Magic Mirror Config Sample
 *
 * By Michael Teeuw http://michaelteeuw.nl
 * MIT Licensed.
 */

var config = {
    port: 8080,

    language: 'en',
    timeFormat: 24,
    units: 'metric',

    modules: [
        {
            module: 'alert',
        },
        {
            module: 'clock',
            position: 'top_left',
            config: {
                displayType: 'analog',
                analogFace: 'face-001',
            }
        },
        {
            module: 'calendar',
            header: 'UK Holidays',
            position: 'top_right',
            config: {
                calendars: [
                    {
                        symbol: 'calendar-check-o ',
                        url: 'webcal://www.calendarlabs.com/templates/ical/UK-Holidays.ics'
                    }
                ]
            }
        },
        {
            module: 'newsfeed',
            position: 'bottom_bar',
            config: {
                feeds: [
                    {
                        title: "BBC UK News",
                        url: "http://feeds.bbci.co.uk/news/uk/rss.xml"
                    }
                ],
                showSourceTitle: true,
                showPublishDate: true,
                showDescription: true,
            }
        },
    ]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = config;}

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

That config seems to run fine here ... Don't see any errors in the log you've sent.
This really is an odd issue.

screen shot 2016-08-01 at 22 41 28

@MrHarcombe
Copy link

That's a similar issue on both a RaspberryPi3 and also in my own c9.io workspace (which is running at the moment on http://magicmirror-mrharcombe.c9users.io:8080/ if you want me to tweak anything).

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

I will probably need to try it on a clean install on the a PI3 to see if I can get the same problem. Till then I can't really solve anything without a particular error message.

@MrHarcombe
Copy link

Out of interest, I've put the config back to as it should be, which doesn't work for me; does it work for you?

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

Yes, if I open your url it works. If I copy your config, it works. If I use the default config, it works. I have no idea what the issue is ...

@MrHarcombe
Copy link

Weird, as that currently doesn't work for me! Could it be down to what the system default language is (ie do you run your OS in English, by default?) and whether the config is pointing at a different language?

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

I run it on a english OS. But the way it's built it doesn't have anything to do with the OS. I suspect it has something to do with a dependency that gives some issues. Therefor I want to try a clean install, but unfortunately I currently don't have the time to try it out.

Are you using the master branch or the dev branch? And could you try npm update from the ~/MagicMirror folder?

@MrHarcombe
Copy link

MrHarcombe commented Aug 1, 2016

I'm using the tag v2.0.3 - but am happy to try any branch you need me to use. npm update didn't produce any output.

I only checked this out this evening, brand new workspace clean clone and npm install.

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

One issue could be that it can't find the translation file. Could you look in de dev tools if it somehow gives a 404 (not found) for one of the files it tries to load?

@MrHarcombe
Copy link

No errors given in the browser console log - last entry is for the two translation files to be loaded, but no errors.

@MrHarcombe
Copy link

Digging into the code, it doesn't seem to be outputting the log message in loader.js:153

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

Could you check the resources tab? (The console won't show a 404.)

@MrHarcombe
Copy link

Um, I don't appear to have a resources tab (I'm in Chrome using the Inspector)?

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

It might be called the network tab.

@MrHarcombe
Copy link

No 404s, plenty of 304s (cache hits?)

@MrHarcombe
Copy link

screenshot 2016-08-01 at 22 36 52

@MichMich
Copy link
Collaborator

MichMich commented Aug 1, 2016

Hmmm no clue then. Will look at it asap.

@MrHarcombe
Copy link

np - sorry I couldn't be more help :(

@MrHarcombe
Copy link

Just to add to the confusion - the system works perfectly for me (including the voice control module) if I use a language of 'de' or 'fr'... frustrating, much?

FYI, the same symptoms appear if I comment out the "alert" module and just leave the "MMM-Voice-Control" module in, which uses translations; if the language is "en" then after the translation and fallbackTranslation are loaded, nothing else happens.

MichMich added a commit that referenced this issue Aug 2, 2016
@MrHarcombe
Copy link

Ooooh...

So, if I rearrange all the various places where translations are listed and make sure "en" isn't the fallback, then the system works for me just fine with a config.js language of "en" - it only seems to be the issue where the language and the fallback-language are the same.

Does that help any?

@MichMich
Copy link
Collaborator

MichMich commented Aug 2, 2016

Sooooo ... just a few seconds ago I used a possible fix to the develop branch. Could you give it a try?

@MichMich
Copy link
Collaborator

MichMich commented Aug 2, 2016

(and indeed, it was exactly what you said. fallback and language were pointing to same file, new electron refuses to reload file twice.)

@MichMich
Copy link
Collaborator

MichMich commented Aug 2, 2016

If you want to give the develop branch a try:

cd ~/MagicMirror
git checkout --track origin/develop

@MrHarcombe
Copy link

Works for me :)

Thank you 👍

@MichMich
Copy link
Collaborator

MichMich commented Aug 2, 2016

Thanks for checking!

@MichMich MichMich closed this as completed Aug 2, 2016
MichMich added a commit that referenced this issue Aug 2, 2016
@causztic
Copy link
Author

causztic commented Aug 3, 2016

Not really related, but
The new electron-prebuilt v1.3.1 is also having issues with a phantom module version (It is using Node v6.3.0 which is ABI 48, but somehow in their repo they are built with ABI of 49). This might cause some issues with compilation for other custom modules - It affected my node-pocketsphinx implementation.

Check out electron-userland/electron-prebuilt#172

@MichMich
Copy link
Collaborator

MichMich commented Aug 3, 2016

@causztic, interesting. I'll keep an eye on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants