-
Notifications
You must be signed in to change notification settings - Fork 2
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
Getting a javascript console error when starting a minimalist project #7
Comments
whoops forget the repo: https://github.com/davidglassborow/perfect-fifth-repo |
Hi @davidglassborow, thank you for reporting this. By following your steps I can reproduce the error, which is good news. I believe it has something to do with Vite; when I use webpack to compile your example, everything works (using config similar to this). This is why the bug only surfaces now I think. In any case, the real underlying problem is the following code that is generated from the perfect fifth library:
Which should be as follows in order to work with Vite.
So I'll have to figure out how to do this, because I'm not that well versed in how Fable handles JS imports. The P5 import is very central to the PerfectFifth library, so hopefully the impact is minimal... An alternative solution is to figure out how to make Vite behave like webpack for handling these kinds of imports. However, I am not that familiar with JS build tools either (i.e. Vite vs webpack differences), but maybe that can be a direction for you to look into. I'm quite busy the coming weeks (exams coming up), so I don't expect to release a fix anytime soon. As a temporary solution, I suggest that you move over to webpack for the time being. The config I linked can be a good starting point if you remove the |
I had a feeling it might be import & Vite related, not that I really understand JS imports, but this stack overflow report seemed similar. I'll swap to Webpack, and will post back if I manage to figure out any changes needed. Hope the exams go well ! |
Hey everyone, I haven’t had time to play with this in a while, but last year I was able to run it with vite https://github.com/anpin/f5-vite-template good luck with your exams @mark-gerarts ! |
Thanks both! @anpin your repository is a great help, apparently things work fine with vite 4.x. Something changed in version 5 causing the issue, so that gives me a good direction to start investigating. @davidglassborow the easiest thing right now is to run |
Perfect, that fixed the problem, thanks both |
Hi @mark-gerarts, thanks for your work on this. I've decided to go through the nature of code in fable, and searching around for p5 bindings, found this library.
I've meticulously followed the fable install instructions, and then tried to implement the simplest possible example from https://github.com/mark-gerarts/perfect-fifth?tab=readme-ov-file#display.
However which ever way I try and use perfect-fifth, I always get the following error in the console:
Have you got any idea what I could be doing wrong ?
I get a similar error (but different object name) trying to use p5js directly
I've created a repo for the absolute minimum steps to get fable + perfect-fifth install, which replicates the issue, with each commit being the steps along the way.
Any help massively appreciated ! I'm not super confident with fable so maybe I'm missing something obvious.
Thanks,
Dave
The text was updated successfully, but these errors were encountered: