MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    UNSOLVED Incompatible modules using chart.js

    Troubleshooting
    3
    2
    62
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jhillairet last edited by jhillairet

      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):
      7dd01d7d-5e18-4d04-a104-ffe5a90ccd7a-image.png

      • 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):

      f8e7a94c-1fce-4b91-8d94-f55ef60ce610-image.png

      • 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,

      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @jhillairet last edited by sdetweil

        @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…

        Sam

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy