P5 example runs, but when I copy the code into a new project P5 functions undefined

Hi @michaelshiloh, welcome!

I followed your instructions, remixing and also “ripping” the content from one of the examples (I used the rotating rectangle) and was able to reproduce your problem.

After a little fiddling, here’s how I solved it:

Copy across the .eslintrc.json file from the original project to your own

Go into the Glitch terminal and run the command refresh

This gives ESLint new rules to play by, and I think somehow the config specified in the original project stops it checking for unknown globals. However, the new config only kicks in after running refresh.

Hope it works for you!!

2 Likes