Answers for "module not found: error: can't resolve './components/"

4

webpack Module not found: Error: Can't resolve '../

resolve: {
    modules: [resolve(process.cwd(), 'src'), 'node_modules'],
    extensions: ['*', '.js', '.jsx', '.json'],
    symlinks: false,
    cacheWithContext: false
  }
Posted by: Guest on September-15-2020
0

Module not found: Can't resolve './components/NavBar'

In your case, App.js is in src/ directory while header.js is in src/components. To import you would do import Header from './components/header'. This roughly translate to in my current directory, find the components folder that contain a header file.

Now, if from header.js, you need to import something from card, you would do this. import Card from '../containers/card'. This translate to, move out of my current directory, look for a folder name containers that have a card file.
Posted by: Guest on October-16-2021
-1

Module not found: Can't resolve ''

# if not installed
npm install <pkgName>

# if installed but gives error, uninstall then install
npm uninstall <pkgName>
npm install <pkgName>
Posted by: Guest on December-21-2021

Code answers related to "module not found: error: can't resolve './components/"

Code answers related to "Javascript"

Browse Popular Code Answers by Language