• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Incompatible modules using chart.js

Scheduled Pinned Locked Moved Unsolved Troubleshooting
4 Posts 3 Posters 511 Views 3 Watching
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 Offline
    jhillairet
    last edited by jhillairet May 7, 2022, 5:40 PM May 7, 2022, 5:30 PM

    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 May 7, 2022, 7:37 PM Reply Quote 0
    • S Offline
      sdetweil @jhillairet
      last edited by sdetweil May 7, 2022, 7:40 PM May 7, 2022, 7:37 PM

      @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

      How to add modules

      learning how to use browser developers window for css changes

      J 1 Reply Last reply May 22, 2022, 7:00 PM Reply Quote 0
      • J Offline
        jhillairet @sdetweil
        last edited by May 22, 2022, 7:00 PM

        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.

        S 1 Reply Last reply May 22, 2022, 8:53 PM Reply Quote 0
        • S Offline
          sdetweil @jhillairet
          last edited by sdetweil May 22, 2022, 9:05 PM May 22, 2022, 8:53 PM

          @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

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          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 Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy