Read the statement by Michael Teeuw here.
Delay loading of one instance of a module and not another
-
Thank you for the advice. I looked at your module and some others that allow for multiple instances but could not get it to work. I looked at some of the requests for multiple instances in the original (https://github.com/morozgrafix/MMM-horoscope) and the author commented that it would require rebuilding the entire module.
As a work around, I cloned a second MMM-horoscope module and renamed the folder to MMM-horoscope2. Then renamed MMM-horoscope.js and MMM-horoscope.css to MMM-horoscope2.js and MMM-horoscope2.css. Then renamed all the .MMM-horoscope in the css to .MMM-horoscope2. Finally, I ran npm install in MMM-horoscope2 folder followed by npm install node-fetch@2. -
@DDE12 that’s the second approach
-
@DDE12 use my fork, which supports multiple instances
https://github.com/sdetweil/MMM-horoscope
to test, rename the old module folder to some other name
git clone and npm install for my module
change the module name of your additional instances to the same as the 1st (now my module)
if it fails, just rename my module folder out of the way,
put back the other module folder
and restore the module names in config.jsit was a tiny change, so I think it will work
-
@DDE12 I just added another update in case this module is used on a nodejs version below 18 to load a lib to support fetch
-
@sdetweil Seems to be working great! Thank you very much for taking the time to make this a multi-instance module! Also great that you eliminated the need for npm install node-fetch@2. Even though I don’t know very much about java script, I understand it much better than these horoscopes :grinning_squinting_face: