Tsparticles: Uncaught TypeError: Cannot read property 'numberOfItems' of undefined

Created on 1 May 2020  ·  1Comment  ·  Source: matteobruni/tsparticles

tsparticules does not load when use din browser due to error. tested on v1.13.5 with Firefox 74.0 and Vivaldi 2.10.1745.27

To Reproduce

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tsparticles.min.js"></script>
<script>tsParticles.load('particles-js', particlesConfig);</script>

where particlesConfig is taken from the polygon mask example : https://particles.matteobruni.it/# and select preset "Pylogon Mask" in the drop down menu

Desktop (please complete the following information):

  • OS: Windows 1909
  • Browser: Firefox 74.0 and Vivaldi 2.10.1745.27
  • Version: v1.13.5

Workaround

Add the pathseg polyfill

<script src="https://cdn.jsdelivr.net/npm/[email protected]/pathseg.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tsparticles.min.js"></script>

I might have skipped it but it should be indicated in the docs that this polyfill should be added.

Most helpful comment

Just realized this is already in the README, 🤦‍♂️

You may have notices the * near dependency free. Well almost all features works without any dependency, but... Well there's a but. The Polygon Mask feature requires pathseg for some browsers to work fine, and obviously the Icon Fonts (like FontAwesome) must be included in your page.

source : https://github.com/matteobruni/tsparticles#dependencies

Well this issue might still help others to quickly find the solution !

>All comments

Just realized this is already in the README, 🤦‍♂️

You may have notices the * near dependency free. Well almost all features works without any dependency, but... Well there's a but. The Polygon Mask feature requires pathseg for some browsers to work fine, and obviously the Icon Fonts (like FontAwesome) must be included in your page.

source : https://github.com/matteobruni/tsparticles#dependencies

Well this issue might still help others to quickly find the solution !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

microraptor picture microraptor  ·  3Comments

matteobruni picture matteobruni  ·  4Comments

jeffgoh picture jeffgoh  ·  4Comments

darekaze picture darekaze  ·  3Comments

matteobruni picture matteobruni  ·  5Comments