Read the statement by Michael Teeuw here.
Incompatible modules using chart.js
-
Dear all,
I’d like to use two different modules, namely MMM-WeatherChart and the no more maintained MMM-Chart.
If my config defines these two modules such like:
{ "module": "MMM-WeatherChart", "position": "top_center", "config": { ... } }, { module: 'MMM-Chart', position: 'bottom_center', header: 'Production Solaire', config: { ... }, },
then only the second one (MMM-Chart) is visible (at the bottom):
- If I switch the order of the first and the second modules in the config file, then the WeatherChart would be visible instead (at the top of the screen):
- If I comment one of these two modules in the config file, then the uncommented module gets visible.
So it seems only the last module defined in the config file is visible.
Is there a known incompatibility issue for 2 modules that are using chart.js (as both are)? If not, what could be the reason for this behaviour?
Any help would be appreciated,
Best regards,
-
@jhillairet yes, sadly modules that use the same library may run into version conflicts…
currently there is no way to get isolation between module’s libraries
i had the same problem with the qrcode library…
for testing u can look at the other module’s package.json file to see what version they requested…
u should be able to see the error in the developers window console
ctrl-shift-i, select console and scroll up for errors…
u ‘might’ be able to filter on your module (when its second in config.js) to see the error… (usually in red text)…i don’t remember where the error is reported and if u can detect it… (I would null out getScripts() response if it was already loaded and caused an error…
-
I repost my message since it appears it never been posted…
@sdetweil thank you for your help! Unfortunately, no issue are produced, so I don’t know how to progress on that.
-
@jhillairet the modules will have to agree on the chartjs version used.
pick one and change the others version number in package.json
then npm install that one again after the change