score:1
because you are doing default export from routes.js
file not named export, and importing it as named export.
use this:
import routes from './routes'; //remove {}
score:1
you have used 'export default' in routes.js, this means that to import it you need to use:
import routes from "./routes";
in your code you have used {routes} which would import when exported without the default.
score:4
you are using default export, you need to import it as default (without curly braces):
import routes from './routes';
on the other hand you can use named export and import it by name:
// index.js
export const routes = ...
// routes.js
import {routes} from './routes';
Source: stackoverflow.com
Related Query
- How to fix this error : " Module not found :can't resolve popper.js "
- "module not found : Error: Cannot resolve module 'react/lib/ReactMount' "
- Cannot resolve module "firebase" from 'firebase.js' : Firebase could not be found within the project
- How to resolve module not found error in webpack/reactjs app?
- webpack: ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' .jsx
- How to fix Next.js Vercel deployment module not found error
- cannot evaluate module 'react-native-maps' : Configuration with name 'default' not found
- Module not found Error when deployed on Heroku
- Error after update: Cannot resolve module 'react/lib/ReactMount'
- Typescript Module not found Can't resolve
- Module not found Error: Can't resolve 'history' in @types/history
- Module not found: Error: Cannot resolve module 'fs'
- Module not found: Error: Cannot resolve module 'react-addons-test-utils'
- Firebase-Admin, importing it to react application throws Module not found error
- why do i get the Error Module not found: Can't resolve 'redux'
- Module not found: Error: Cannot resolve module 'react-redux'
- Module not found error using Yarn 2 to link React components
- Module not found: Error: Cannot resolve module 'react' when I use webpack
- ERROR in Entry module not found: Error: Can't resolve 'babel-loader'
- Module not found: Error: Cannot resolve module 'routes'
- I cannot understand " Module not found: Error: Can't resolve 'fs' '"
- Error in Entry Module not found - in Webpack Config file
- Webpack: ERROR in ./src/index.tsx Module not found: Error: Can't resolve './App' in '...'
- how to solve the error that fs module is not found when used react and next.js
- Module not found: Error: Cannot resolve module 'components/app'. webpack + reactjs issue
- `react-map-gl` ERROR Module not found error [MAPBOX]
- Getting the error : Module not found: Can't resolve 'firebase/app'
- webpack config error of cannot resolve module
- Module not found: Error: Cannot resolve 'file' or 'directory'
- bcrypt, sequelize ERROR in ../node_modules/node-pre-gyp/lib/publish.js Module not found: Error: Can't resolve 'aws-sdk'
More Query from same tag
- Weird value bug onChange in React JS
- react-cornerstone: Cannot read property 'getEnabledElement' of undefined
- Components does not render by Routes
- How do I create typescript components in a javascript project using bit?
- React hook useState not updating onclick
- Use child interface as prop interface with generic interface
- TypeError: Object(...) is not a function error in useAccordianToggle
- How do I fix white flickering on an animated background image?
- The browser makes 4 requests when sending data to the server
- this.prop is not getting though right
- React: Passing Props from grandparent to grandchild
- React redux do not propagate state
- Input value is None from child component using useRef
- How to view formatted xml in a React Dialog
- React-router: unable to pass context
- React hook set state
- Reset a react-query useQuery hook to clear data on the rendered page
- hide delete icon from first row of table - reactjs
- How to use nested loop in react
- Uncaught TypeError: Converting circular structure to JSON --> starting at object with constructor 'FiberNode'
- Align IconButton with Text in a line
- How does webpack handle multiple files importing the same module React
- Handling errors within custom SWR hook
- React native redux not updating component
- How to apply mixpanel on event 'triggering' of dropdown in antdesign
- Cannot setstate in nested axios post request in react
- Pass 'this' object to component - Typescript / React
- How can I set a variable on a function component with Typescript
- Why I can't display my images in react.js
- Promises not handled through Redux