question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tsParticles stopped working after upgrading from 1.x to 2.x

See original GitHub issue

Contact Details

No response

What happened?

Upgrading from tsparticles 1.43.1 to tsparticles-engine 2.0.5 isn’t working. Are there any migration notes? Also, links to examples in the documentation are broken.

Thanks for the amazing work on this project and for any help get it back up and running.

Version

2.0.5

Which library are you using?

Vanilla (tsparticles)

tsParticles Configuration

const defaultParticles: SingleOrMultiple<RecursivePartial<IOptions>> = {
    "particles": {
        "number": {
            "value": 200,
            "density": {
                "enable": true,
                "value_area": 1000
            }
        },
        "color": {
            "value": "#ffffff"
        },
        "shape": {
            "type": "image",
            "stroke": {
                "width": 3,
                "color": "#fff"
            },
            "polygon": {
                "nb_sides": 5
            },
            "image": {
                "src": SnowflakeImage,
                "width": 512,
                "height": 512
            }
        },
        "opacity": {
            "value": 0.5,
            "random": false,
            "anim": {
                "enable": false,
                "speed": 1,
                "opacity_min": 0.1,
                "sync": false
            }
        },
        "size": {
            "value": 5,
            "random": true,
            "anim": {
                "enable": false,
                "speed": 20,
                "size_min": 0.1,
                "sync": false
            }
        },
        "line_linked": {
            "enable": false,
            "distance": 50,
            "color": "#ffffff",
            "opacity": 0.5,
            "width": 1
        },
        "move": {
            "enable": true,
            "random": false,
            // speed: 5,
            "speed": {
                "min": 2,
                "max": 6
            },
            "direction": "bottom",
            "straight": false,
            "out_mode": "out",
            "bounce": false
        }
    },
    "interactivity": {
        "detectsOn": "window" /* this disables the pointer events on canvas */
    },
    "retina_detect": true
}

What browsers are you seeing the problem on?

Chrome

Relevant log output

no particles rendering. no error log.

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
steve-taylorcommented, Jun 7, 2022

If anyone came here from Google trying to upgrade react-tsparticles from v1 to v2, here’s what worked for me:

  1. npm i react-tsparticles@latest tsparticles@latest
  2. In the module that uses the Particles component:
    import {loadFull} from 'tsparticles';
    
  3. Change
    <Particles options={options} />
    
    to
    <Particles options={options} init={loadFull} />
    

Coming from 1.36.0, I also had to add the following to my config:

fullScreen: {
    enable: false
}
0reactions
matteobrunicommented, May 16, 2022

The website is being updated soon with some video tutorials, and the documentation is fine for 2.0, closing this reminder

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Module not found: Can't resolve 'tsparticles' in '/home ...
I am unable to use react particles in my project. Following the documentation, i installed react-particles, and when it did not work, i ......
Read more >
tsparticles - npm
Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for ...
Read more >
tsParticles - v2.6.0 - JS.ORG
Documentation for tsParticles - v2.6.0. ... Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js, ... pause will stop the animations
Read more >
tsParticles 2.0.2 is out. Breaking changes ahead, but keeping ...
Breaking changes ahead, keeping the 1.x support. ... Better performance, since a lot of features are not imported, they are not running ......
Read more >
[AskJS] How do you release libraries updates with breaking ...
I'm working on a new version of a npm library and the v2 changelog is ... Then publish a patch on 1.x that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found