React Project - Module not found

<%= @topic_view.topic.title %>
<%= @topic_view.topic.average_rating %> <%= @topic_view.topic.posts.count { |p| !!p.custom_fields['rating'] } %>

Hi folks,

I am making a project in react and I am getting the error

Failed to compile.

Module not found: You attempted to import /.components/AddTodo which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.

Despite it being in the /.components/AddTodo

Here are some screenshots:

Read the error message carefully, it’s telling you what you’ve done wrong: you’ve written `import AddTodo from “/.components/AddTodo”, the first two characters are the wrong way around

1 Like

Sorry I still do not get it. Dumb I know but I am not sure what you mean.

Does this help?

Look at line 3 vs. line 4. You have the forward slash and dot mixed up.

1 Like

Oh man!!! 2 days on this before I asked for help! Sometimes it needs a fresh pair of eyes right! Thank you both for help.
Oh man, gutted.

Sorry, I wasn’t totally clear there. And (depending on operating system) the error message, specifically, is because when you’ve got the dot and the slash the other way around, what it’s trying to resolve is a file called “AddTodos.js” in a folder called “.components/” in the computer’s root directory