My abbreviated file structure is something like ( check bottom of post for more detailed description):Īnd under components I have my actual app in a folder and another folder under components where I planned to store my "resources" so:Ĭomponents/my-app-folder/my-actual-app.tsx I'd figure by looking at guides and examples I could figure it out, but I haven't been able to. Now while I am not super proficient in file paths etc. Simple stuff but I'm running constantly into the following error: So I have an app where I have a button on the web page that the user can push to play a mp3-file. I will edit the title once we figure out what my issue exactly is.
So to start with I'm not sure if my problem has to do with importing/linking my mp3 file OR with how to play audio clips in React (or something else). Solving this issue for any other import of an component would be to make sure that the component that is being imported has also been defined to be exportable but how would one go about doing this to an MP3-file? "Cannot find module "./neure-resources/test.mp3" Import soundfile from "./neure-resources/test.mp3"
The current issues is that when I try to use: The problem lied with my lack of knowledge in the environment I was working on but the answers given below should be useful for others with similar problems.ĮDIT: As it seems the problem is that there's something funky going on with trying to import my mp3 to my React app/component.