I’m making a small React project that’s a Chip8 interpreter, and I’m confused about how to properly retrieve the ROM files using the Fetch API.
The project’s file structure. I previously had the roms folder in the Public directory in the root before placing it in the src directory.
The Vite.config.js file
Regardless of the path I use for the URL object in the test method, I don’t get the correct data for the given ROM file in the fetch response on line 30 of RomBuffer.js. When I had the roms folder in the public directory, I would get an HTTP 200 response from on line 30 with the Blob and ArrayBuffer objects having lengths of 0.
Currently, with the roms folder being in src, I’m getting this error: