Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference error in new version (1.2.0) #29

Closed
shtrih opened this issue Jun 2, 2019 · 4 comments
Closed

Reference error in new version (1.2.0) #29

shtrih opened this issue Jun 2, 2019 · 4 comments

Comments

@shtrih
Copy link

shtrih commented Jun 2, 2019

I updated the library, but now I get an error ReferenceError: p5 is not defined:
chrome_2019-06-02_06-56-54

@and-who
Copy link
Contributor

and-who commented Jun 3, 2019

Hi, I removed p5 as a Dependency of the p5-wrapper so everybody can choose which p5 Version he is using.

So you need to add p5 as an Dependency by yourself.

Try:
npm install p5 --save

@shtrih
Copy link
Author

shtrih commented Jun 3, 2019

Yes it's already in my dependencies and looks like the exception thrown from p5.dom

@and-who
Copy link
Contributor

and-who commented Jun 3, 2019

I just removed the addons. (I was not sure if I should add them anyway)
Can you try Version 1.2.1?

@shtrih
Copy link
Author

shtrih commented Jun 3, 2019

I'm sorry I found the problem.
The problem is in p5.dom.js. Someone added 2 functions but in wrong place. This two functions should have been added before }); (line 3118).
processing/p5.js@9b5094a#diff-84dfcaf5d56a24f4ee13a32c644817b0R3118
Those changes was released in 21 Jan in 0.7.3. Then this problem was fixed 23 Jan (processing/p5.js@8c75c73#diff-84dfcaf5d56a24f4ee13a32c644817b0). But this fix were in the next release 0.8.0, which took place after 3 months on 9 Apr!

  1. I started my project in march so I used latest p5.js 0.7.3.
  2. I did not use the library p5.dom.js so the error did not occur.
  3. Then I added react-p5-wrapper it uses own p5 package 0.5.5 so the error did not occur when I started using of p5.dom.
  4. When I updated react-p5-wrapper to 1.2.0 it began to use p5 from my project which is 0.7.3. I have created this Issue.
  5. I have updated p5 to 0.8.0 and error is gone.

Now I update react-p5-wrapper to 1.2.1. So to use dom library I import corresponding file in my sketch.js: import "p5/lib/addons/p5.dom";.
🤯

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants