Read the statement by Michael Teeuw here.
MMM-Random Fact
-
Well for me this module does not work as well (only showing “Eine Tatsache bekommen” in German) and I have again Unhandled Rejection Warnings, which are not errors however… but I have the feeling they are related to the problem.
(node:25288) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error 0|mm | (node:25288) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 0|mm | (node:25288) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): ErrorI only get these when I activate this module
-
@lavolp3 said in Random Fact:
I only get these when I activate this module
I’m not seeing that at all and I have plenty of modules loading along with it. Have you tried running this module by itself?
-
Is there a config option to show/hide the “Random Fact” title if you just want the fact?
Alternatively, would positioning and colour customisation of the title be done in CSS? -
Both can be achieved in custom.css file
.MMM-rfacts .title { display:none; (or positioning and colour customisation) } .MMM-rfacts .description { (positioning and colour customisation code here) } -
Great, thank you. I will take a look at that when I have a little bit of spare time.
-
@mykle1 yep, it does work ONLY when set to english but other languages has a problem as stated here due to error in
promise.all()function Here …please try to change your language to any other to confirm the error and let us know.@lavolp3 it’s the same error of mine.
-
Ahh ok. I’m sure the author will address the issue when he has time.
-
Is fixed…git pull…enjoy your weekend. Thanks @Mykle1
-
I’m getting the same issues.
entry in config:
{
disabled: false,
module: ‘MMM-rfacts’,
position: ‘bottom_bar’
},
but it only shows “Ein Tatsache bekommen…”. I did “git pull” today and I am up to date.Any hint?
-
@dirkie Yes…the api is strange… if you hit it too many times they will lock you out for a couple days…
Give it time and it should work again.
-
I am still having an Unhandled promise rejection:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 13): TypeError: Cannot read property 'refs' of undefinedMy config is completely stripped down now as the new Readme suggests. No config entries.
Loading message is in German which is my language.
However translation still does not seem to work here.Any suggestions?
-
I will look at it again tonight they may have changed the api… stay tuned.
-
I just tested mine and it’s working fine… I reuploaded mine to make sure there are no errors in the one on Github…
Also here is my config:
{ disabled: f, module: 'MMM-rfacts', position: 'top_left', },The language selection is taken directly from your language selected in the config file… I switched mine to ‘de’ and it worked fine. So what I would do if I were you is to delete it all and do the git clone thing and then run npm install in the MMM-rfacts dir …
-
@cowboysdude
Thanks dude :-), will try it out later today -
Hi guys.
I’ve tried to get this module working again and am still failing.
I was able to find out the following:
My general config is mentioning
language: 'de'
When I set this to en, the module works.
With language de, it does not give a translated fact.Now the above mentioned “unhandled promise rejection” warning is not the problem.
You can solve this issue by adding a .catch() phrase after the .this in the promise part to catch and process a rejected promise.Since the translate() function does not properly work, the promise gets rejected, and since there is no rejection handing in the code, we get the “unhandled rejection” warning. I’ll try to set up a solution and send a PR.
The translation problem with this module apparently lies in the google-translate-api.
I was able to console.log the error message
at /home/pi/MagicMirror/modules/MMM-rfacts/node_modules/google-translate-api/index.js:106:17 at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) code: 'BAD_REQUEST' }This error is well known for the google-translate-api since 2018.
The question is:
Does this module work for anyone in another language? (and if yes: WHY?) -
Well…
“Eureka!”Apparently the problem is solved using this hack. There seems to be an issue with the google-translate-api npm module that some users solved with a fork.
@cowboysdude look at it and let me know what you think.
If the issue/solution is confirmed a workaround would be to have a working fork installed via npm.(need to get back to work now!!..)
-
It’s odd that noone else seems to have the translation problem.
However, I have just pushed a PR including a promise.catch function in case translation does not work.
This module still only works with the “manipulated” google-translate-api" for me.Love your module, @cowboysdude . Many great facts received in recent months.
-
@cowboysdude
I’m afraid the link is broken in your module.
Directly visiting http://www.fayd.org/api/fact.xml redirects to a facebook page.Node_helper.js returns a promise rejection because there’s no
bodyelement to be fetched.
Can you please check? -
@lavolp3 Thank you!! That is very interesting and I will look into that right now!!! Will let you know.
I looked…looks like I’ll have to rewrite parts of it and I will and repost as soon as it’s done…later tonight :)
-
@lavolp3 I have it working… it’ll be a day or so to upload it as I do have one very strange error that I want to correct :)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login
