wufe / react-particles-js

Particles.js for React
https://rpj.bembi.dev/
MIT License
1.16k stars 106 forks source link

Polygon Mask not working with Gatsby #90

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi, there! I am getting the following error in my console.

particles.js:1 Uncaught (in promise) TypeError: Cannot read property 'numberOfItems' of undefined
    at particles.js:1
    at Array.forEach (<anonymous>)
    at particles.js:1

Any idea why I am getting this error? My SVG image is in my static folder, so it is accessible via root. I am unable to find a solution to this issue.

wufe commented 5 years ago

You need to add the svgpathseg polyfill.

<script src="https://cdn.rawgit.com/progers/pathseg/master/pathseg.js"></script>
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

iagokrt commented 4 years ago

I am wondering where should i add svgpathseg ? ``

`` into the static folder but where?

SippingCode commented 4 years ago

https://www.gatsbyjs.org/docs/custom-html/

This section can help. When copying your html.js add your Githubissues.

  • Githubissues is a development platform for aggregating issues.