1

I am building a Spotify Application with their web API and am running the front end with React. I am importing my actions to my component, but I get this error

Failed to Compile

./src/SearchBar.js Module not found: You attempted to import ../actions which falls outside of the project src/ directory. Relative imports outside of src/ are not supported. You can either move it inside src/, or add a symlink to it from project's node_modules/.

But my actions folder is 100% within my src directory of my client. I have imported Actions in the past, but for some reason it's different, does it have something to do with my server?

Screen of my directory

Thanks for checking it out!

James H
  • 161
  • 3
  • 13

1 Answers1

4

When you use ../ you're trying to access to the parent folder. That's why now you're out of the src folder.

If you want to import something at the same level, you should use ./ In your case ./actions/yourFile

Alan
  • 470
  • 4
  • 10