score:0
final update in webpack.config.js
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
cachedirectory: true,
presets: ['react', 'es2015', 'stage-3']
}
}
score:1
as pointed out in a comment there has to be something with babel configuration that webpack can't transpile jsx syntax.
check out if you have babel-preset-react installed and turned on:
"presets": [
"react"
],
little nitpick - use caching for faster incremental builds:
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
cachedirectory: true,
},
},
},
Source: stackoverflow.com
Related Query
- Build Failure while using webpack production build
- Deploying build to production using express server which i compiled using webpack -p
- Webpack production build always returns This page is using the development build of React
- Webpack how to build production code and how to use it
- Why is React Webpack production build showing Blank page?
- How can remove console.log in the production build of a React application created using create-react-app?
- Why does production build of React app (with Webpack and Babel) use wrong development env with HMR, which causes errors?
- Error using component done with react,redux and react-redux and build with webpack in react application
- How to disable strict mode while bundling React using webpack
- Webpack config for Code splitting not working for production build
- How to move css-in-js (Styled Components) to an external css files during build using webpack - ReactJS
- global is not defined while using socket.io-client with webpack
- bundle.js missing from webpack build when using webpack-dev-server
- getting build errors while using aws-iot-device-sdk in reactjs application
- webpack production build not working
- Webpack production build file paths are off
- Errors on grunt build using google-api-nodejs-client with webpack
- SSR + Material UI Drawer + webpack production build broken
- Webpack file-loader not loading assets folder in production build
- Array shuffle working while developing but not on production build (React/Gatsby)
- React Router - Route not working on Refresh in webpack production build
- Getting error while creating production build 'does not contain a default export'
- How to handle the refresh in production build using react-router
- vendors.js: Uncaught TypeError: Cannot read property 'apply' of undefined while using webpack
- React-Router dose not work while using BrowserRouter after Build
- Module parsing failed while using webpack 4 for a react project
- Webpack UglifyJS fall in error for production build because of MQTT.js existance
- Why does my routing not work when I upload my webpack production build online?
- Error while importing font or images file inside scss using Webpack 4 and react js
- Exclude node_module/package from production build webpack
More Query from same tag
- How does react decide to rerender a component
- TypeError: items.map is not a function
- Pass Current Table Row values to a subcomponent with onClick of a button in React (Material UI)
- Destructing properties passed to child function
- How to handle fetch API AJAX response in React
- How to fix - Module not found: Can't resolve '@babel/runtime/helpers/objectWithoutPropertiesLoose'
- Accessing context values outside of Context.Consumer
- Get object from another class in component react
- I want an idea for filtering option in reactjs
- How to prevent selected long string values from getting truncated in the react-select control?
- CSS lower down/cut an edge
- React useState hook not updating within async useEffect
- How to disable selected values from getting displayed in input bar in react-select?
- Scroll to List Item on Unordered List after new list item is added through mutation
- react useState enters infinite loop even thou variable is the same
- Add new element to object after it created
- Issue with immediate rerendering when input value is change in text field
- How do I refresh a react component by clicking on a button outside the component?
- Redux Data Flow with React-hooks
- useRef([]) with dynamically created elements
- Filtering When a Button is clicked
- In React, how do you apply componentDidMount for this type of component?
- React - How can I set "message from me"
- React/Material-UI: How can I map multiple tables from a JSON object with more than one array of data?
- Firestore: How to update array on a condition and nested array
- How to fix the Argument of type 'Date[]' is not assignable to parameter of type '(prevState: undefined) in react
- Unable to create instance to Cropperjs using react-cropper
- Every new Item added displays the same Date-Time
- Testing inline callback functions in React using Jest
- Firebase query with React