processing / p5.js-web-editor

The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything.
https://editor.p5js.org
GNU Lesser General Public License v2.1
1.34k stars 1.29k forks source link

ReferenceErrors when running tests in Docker #3190

Open tespin opened 1 month ago

tespin commented 1 month ago

p5.js version

2.14.0

What is your operating system?

Mac OS

Web browser and version

Firefox 122.0

Actual Behavior

npm run test fails on several test suites with the following errors:

ReferenceError: $RefreshSig$ is not defined ReferenceError: $RefreshReg$ is not defined

Tests were run on a fresh Docker installation of the repo on the develop branch, using docker compose version v2.28.1-desktop.1.

Screenshot is attached but here are the affected test suites for me:

Screenshot 2024-07-16 at 12 18 13 PM

Expected Behavior

Tests for affected components should run.

Steps to reproduce

Steps:

  1. Follow Docker installation instructions to set up dev environment.
  2. Open a terminal in the Docker server with docker compose -f docker-compose-development.yml exec app bash -l.
  3. Run npm run test.

It's my first time setting up p5 locally -- the app runs fine in my browser but I'm unsure how to troubleshoot these errors! Thanks for the help.

welcome[bot] commented 1 month ago

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

raclim commented 1 month ago

Thanks for raising this issue @tespin! I realized recently that some of the Docker setup isn't up to date since I don't use it too often 😅 so I'm sorry about any issues that you've been facing here!

I know that while our tests currently pass, they do have a few issues/warnings that pop up but will probably be addressed once the related components are refactored. However, I haven't encountered this error in particular, so I think it's probably stemming from how things are set up in the Docker configuration files. It also seems like this error is related to @pmmmwh/react-refresh-webpack-plugin, so the setup for this plugin may need to be adjusted as well. I'll try to take a further look into this and hopefully have an update by tomorrow!

tespin commented 1 month ago

lol no worries! I was so stumped yesterday but will keep troubleshooting. I'll do the manual install in the meantime -- thanks for your attention @raclim.

raclim commented 1 month ago

Sounds good, I'll try to keep looking into this as well! Thanks so much for being flexible!