ParticlesJS is not defined
See original GitHub issueHello, I’ve been trying to get particles js to work with vuepress. On my config I have:
head: [
['script', {src: 'https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js'}]
]
It works when I run vuepress dev
but as soon as I try to build with vuepress build
I get the error saying ParticlesJS is not defined
even though it is there and working.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Uncaught ReferenceError: particlesJS is not defined
However, it stopped working today with no changes made to the site. The console says: Uncaught ReferenceError: particlesJS is not defined. We ...
Read more >particlesJS not defined · Issue #218 · VincentGarreau/particles.js
Uncaught ReferenceError : particlesJS is not defined at (index):911 This is my Code:
Read more >Particles.js error 'particlesJS' is not defined - Roots Discourse
I've been trying to integrate particles.js into my theme., however, I keep running into the error "error 'particlesJS' is not defined".
Read more >PARTICLE.JS -- Uncaught ReferenceError: particlesJS is not ...
Basically the issue is that ParticleJS is undefined and won't load properly. this is the error I'm receiving: index.html:18 Uncaught ...
Read more >tsparticles - npm
Not Bundle. This installation requires more work since all dependencies must be included in the page. Some lines above are all specified in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
First I recommend you use this library, https://github.com/lindelof/particles-bg-vue.
Then the problem you mentioned is solved here https://github.com/nordicgiant2/vue-nice-homepage/blob/master/docs/.vuepress/components/Homepage.vue
If you have some scripts which rely on the loading script, it actually means that you are accessing window, which will offend the Browser API Access Restrictions
For solving your problem, you should install it at your project and
external
ize it:In you client code, you should using es import instead of
window.ParticlesJS
: