[Ravenous] Module not found: Can't resolve './logo.svg'

Hi All

I’m working on the react ‘ravenous’ project

I’m busy going through the project build and I’ve run into a weird snag.

Step 8 requires:

Each component should have its own folder inside of components/ . Inside of the components/ directory create a new folder called App . Move App.js and App.css to the App/ folder and update the path in index.js accordingly. Remove App.test.js from the src/ folder, as you will not use it in this project.

I have followed this, and updated the files as required. but I’m getting the following error when I launch

Failed to compile

./src/components/App/App.jsModule not found: Can't resolve './logo.svg' in 'C:\coding\ReactApp\ravenous\src\components\App'

This error occurred during the build time and cannot be dismissed.

This is the code I have in the App.js

import React from 'react'; import './src/components/App/App.css'; import logo from './logo.svg';

Below is my folder structure

My best guess is that this is an ENV issue, and the ./ isn’t resolving to the root directory of the project but to the root of where App/ is. I don’t know enough about this to correct it? I’m running on windows.

the Component is looking for logo.svg in the App folder because you use just one dot. The image is one level up in the components directory. You need to write ‘../logo.svg’.

Thanks for the reponse,

that makes sense, however, and maybe you can explain this to me, I was under the impression that ‘./’ tells the editor to look from the root directory of the project. instead of having to provide a relative address.

thank you again, I will see if I can get this to work in the interim.


../ and ./ are both relative paths. If you are developing on a local host and rightclick on an image for taking a look at the path you’ll probably see that the path has been changed to a static path. I think you can access the public directory with a shortcut.