1

Trying to import my folders but they keep on saying that cannot find folder but the folder I'm import is the correct:

./src/LoginPage/Login.js Module not found: Can't resolve '../_actions' in >'/Users/mirasmith/Desktop/KPV1-Project-master/src/LoginPage'

I don't know how to show the image so if someone can help fix it. Here the link to the folder hierarchy.

https://gyazo.com/410386debd550039400cf40e9e448196

Brandon Powell
  • 99
  • 3
  • 10
  • show us the import for `../_actions` – Train Aug 13 '19 at 19:42
  • Could you add the source code in Login.js? – Etin Aug 13 '19 at 19:44
  • The error message is suggesting that you're trying to import the _actions folder inside the LoginPage folder. You need to take it out one step further. – Stephan Olsen Aug 13 '19 at 19:45
  • `LoginPage` is a directory; without knowing what you're actually doing in your code (e.g., the import itself, and from which file) there's no way to help. It's likely you're just wrong w/ the relative include path, as Stephan said. Questions need to be complete--this is not. Also note that it's pretty easy to get a text-oriented directory tree; images are almost never the best way to communicate information contained in text. – Dave Newton Aug 13 '19 at 19:53

1 Answers1

1

Does _actions have a index.js? When require is given the path of a folder, it'll look for an index.js file in that folder. If there is one, it uses it. If not, it doesn't know what file you're trying to import.

If you don't have an index.js in there, you'll need something like: "import actions from ../_actions/filename.js"

If you are trying to do an import of all the files from a folder, this answer talks about how to do that:

https://stackoverflow.com/a/5365577/5216218

import alert from "../_actions/alert.actions.js" 
import user from "../_actions/user.actions.js"
Eric Jones
  • 86
  • 8