Ravenous Part 1 Failed to compile

Hi All,

I’ve read through every previous problem everyone had posted about Part 1 of Ravenous project, but none of the solutions resolved myproble, yet it looks like we have the same errorr message… I tried with 1 and 2 dots, neither resolves my problem.
import SearchBar from ‘…/components/SearchBar/SearchBar’;

import BusinessList from ‘…/components/BusinessList/BusinessList’;

I also tried to install Babel, it failed,could the root of the problem be, me not setting up GitBash properly ? If I un and re install GitBash and do the setting again could work ?

Mant thanks

Your App.js file is in the src/components/App/ directory.

Using ../ in your import means that it is the src/components/ directory.

Therefore, if you use ../components/ instead, it’s trying to use the directory src/components/components/, which isn’t correct.

You could use ../SearchBar/SearchBar, which means it’s using src/components/SearchBar/ and then since the file extension wasn’t required, it adds on SearchBar.js. That’s the file you’re after.

So either use:
or even

The last one would technically work too since it goes to the parent directory of the parent directory, which means src/ so it would still require components/ too.

I hope this help and doesn’t cause more confusion.

Hi :slight_smile:

Many thanks for your help.

I tried your way but still doesn’t work I don’t know what else to do :disappointed:

Was it still complaining about App.js after you fixed each of the import statements? Or was it now complaining about other files that you still need to fix?

Also, after looking extra closely at your screenshot, it looks like your SearchBar.css and SearchBar.js weren’t put in the SearchBar directory, so that could be leading to a lot of confusion and issues too.

If you published your project to GitHub, you could share the link here and we can take a look at it.

Alternatively, you could post each of your .js files in the forums using this option so the code is formatted properly:

I’m speechless

You sacrificed your free time to look into this even deeper. You are a star :dizzy: :medal_military:

What a silly mistake :tired_face: to be honest I found it myslef :unamused: and I feel ashamed, With the correct file path in App.js, the one you suggested… of course it compiled straigh away.

I’m so grateful for your help! I hope one day I will be able to help others as well.

Thanks again !

1 Like

You’re welcome!

All of us have made mistakes like this. They give us real experience that sticks with us. I bet if you encounter an issue like this again, you’ll be able to debug it very quickly.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.