p5 is not defined when trying to use p5.js-sound in v1.0.0
See original GitHub issueUncaught ReferenceError: p5 is not defined
at Object.eval (p5.sound.js?e617:3112)
at Object.eval (p5.sound.js?e617:3160)
at __webpack_require__ (p5.sound.js?e617:84)
at Object.eval (p5.sound.js?e617:2885)
at Object.eval (p5.sound.js?e617:2956)
at __webpack_require__ (p5.sound.js?e617:84)
at eval (p5.sound.js?e617:120)
at eval (p5.sound.js?e617:122)
at Object../node_modules/p5/lib/addons/p5.sound.js (chunk-vendors.js:7513)
at __webpack_require__ (app.js:785)
Getting this error after updating to p5@1.0.0 from p5@0.9.0 in Quasar Vue via NMP.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:13 (2 by maintainers)
Top Results From Across the Web
How to use p5.js sound in instance mode - Stack Overflow
The problem is that i can't find a way to use sound in my sketch using instance mode. the code i have is...
Read more >Audio Tips 'n Tricks - OpenProcessing
This is an ongoing tutorial to help people with the p5.sound library.
Read more >reference | p5.SoundFile - P5.js
Description. SoundFile object with a path to a file. The p5.SoundFile may not be available immediately because it loads the file information asynchronously....
Read more >Untitled page - Zhijun Song - Cargo
https://cdn.jsdelivr.net/npm/p5@0.5.16/lib/addons/p5.sound.min.js can not be loaded. Please make sure resource exists and it supports cross-domain requests.
Read more >Web Audio API - W3C
If the audio or video type pattern matching algorithm returns undefined , set can decode to false. If can decode is true, attempt...
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
Hi @aceslowman Not sure why this issue was closed when the problem persists.
I can confirm it is not a problem with Webpack - the problem exists in all modern module loaders/compilers including RollUp, TypeScript and Parcel.
Having tested more thoroughly, I can confirm P5 add-ons won’t load in the following configurations:
Given the enournous populariity of npm and yarn, this issue means that anyone using those package managers will not be able to use p5 with add-ons.
The suggestions to manually overwrite files saved to node_modules are totally unsustainable - as soon as you install again (locally, or in CI) it will be overwritten.
I see the same issue exists with p5 dom, as is expressed here: https://github.com/processing/p5.js/issues/4479
What was it that changed between v0.9 and v1 that broke it?
I’m unable to get p5.sound to work with p5 (v1.1.9) using npm and can’t seem to get @vanyamil 's solution to work. After downgrading to 0.9, copying over the p5.sound.js to the project directory, then upgrading to latest, it still returns errors.
I am importing with:
And I receive the following error:
I’m not sure if there is a short term fix to apply or if this error is due to my node environment. Is p5.sound.js an AMD module that my webpack config is having trouble with?