score:0
try this const background = require('../bluecardback.jpg').default;
or where you are using the jpg like
<img src={require('../bluecardback.jpg').default} />
score:2
your config is missing a loader for jpg file.
try adding this
{
test: /\.(png|jpe?g|gif)$/i,
loader: 'file-loader'
}
to your module.rules
array in webpack.config
.
Source: stackoverflow.com
Related Query
- Can not import image in javascript . Module parse failed: Unexpected character '�' (1:0)
- Next.js Import image error Module parse failed: Unexpected character '�' (1:0)
- Next js import scss error(ModuleParseError: Module parse failed: Unexpected character '�' (1:0))
- Module parse failed: Unexpected character '@' (1:0)
- React Module parse failed: Unexpected character '@'
- Module parse failed: Unexpected character '@' (1:0) with Storybook 6.1.11, Webpack 5.11.0, React 17.0.1
- Module parse failed: Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type
- next-images Error: Module parse failed: Unexpected character '�'
- Module parse failed: Unexpected character '@'You may need an appropriate loader to handle this file type.(Webpack : 4.4.0)
- Failed to compile Module parse failed: Unexpected character, when importing or accessing docx file reactjs
- Next.js Module parse failed: Unexpected character '�' (1:0)
- Module parse failed: Unexpected character '@' when using React on Rails with Antd.
- Getting Error: Module parse failed: ... unexpected character '#'
- Getting Module parse failed: Unexpected token (1:0) error when I try to import css file for a specific component in react
- ModuleParseError: Module parse failed: Unexpected character '�' (1:0) in nextjs
- CRA + Inversify @inject Module parse failed: Unexpected character '@'
- React Failed to compile error: Module parse failed: Unexpected token. You may need an appropriate loader to handle this file type
- Failed to compile. Module not found: Can't resolve 'react-router-dom'
- How to fix error "Failed to compile : ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse failed: Unexpected token (10:41)"
- jest: Test suite failed to run, SyntaxError: Unexpected token import
- React unable to import component -- module not found
- Module parse failed: Unexpected token m in JSON at position 0
- Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ReferenceError: document is not defined
- import a module from node_modules with babel but failed
- For a React app, can the build process not create a JavaScript map file?
- Module parse failed: Unexpected token. react-native/index.js "typeof" operator
- React - Module parse failed
- React - Module parse failed: Unexpected Token. You may need an appropriate loader to handle this file type
- Uncaught Error: Cannot Find Module When Using Dynamic Import for JavaScript
- Module not found when import .jsx file
More Query from same tag
- need some enlightenment on the behaviour of the React code
- How to access data from location in react-router-dom 6
- ReactJS - RTL Debug Component Logic
- ReactJS what is the proper way to wait for prop to load to avoid crashing my page?
- How to dynamically render the profile-view once deleting a certain item in the favorites-list to reflect the changes in reactjs app?
- Lifting state not working
- Making the child's input dependent on parent input value
- How to render fontawesome as button in ReactJS
- Nextjs send data (title of page) to component
- moduleDirectories key does not make it possible to import my test utils
- importing stylizations from other files
- Typescript React types not recognised when compiling
- Plot graph using react-d3
- ReactJS & Redux: Can't perform a React state update on an unmounted component
- Unable to disable smooth scrolling in react-scroll scrollToTop
- How to remove Header from a single page in NextJS Layout?
- Make Checkbox required in reactjs
- to many re-renders error react, how to avoid it
- Clicking like icons increases the like count of other components
- React Router is not rendering
- reactjs is using only the first item map() when calling state
- How to show an inputlabel/placeholder/label permanently?
- Setting a checkbox "check" property in React
- React: Looping over an object to bind useState functions is not updating the state of my application
- TypeScript - how should I type these React components?
- React updating single object of an array of objects - map vs entire array
- How can I change an array in object in an array?
- Mui returning Date with Time, flask api returning "incorrect date value"
- How do I create a react list component from an array of objects?
- Retrieving latest state from functional child component using callbacks