Weird 'Module not found: Can't resolve' error
I know this is common issue that is generally solvable by checking the imports thoroughly, but for some reason, I just can't see what is wrong with mine:
The full error reads:
./src/components/BookShelf.js Module not found: Can't resolve './components/Book' in '/Users/../src/components'
Yet my BookShelf.js file's imports are as follows:
import React from 'react' import PropTypes from 'prop-types' import Book from './components/Book'
Any ideas as to why this is happening would be greatly appreciated! Thanks in advance!
Seems like your
BookShelfcomponents are located in
componentsfolder so your import should be
import Book from './Book'
Read the error more carefully.
You're importing from
/Users/.../src/components. There is no
./componentssubdirectory of that (since you're already in that directory).