score:2
Accepted answer
i had the exact same problem today. after adding dynamic-import-node
to the plugins of my .babelrc
the server worked, but webpack wasn't creating the chunks. i then removed it again from my .babelrc
and moved it to my server script with @babel/register
. my server script now looks like this:
require( "@babel/register" )({
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: ["dynamic-import-node"]
});
require( "./src/server" );
i hope this helps ;)
Source: stackoverflow.com
Related Query
- How to set up Babel 6 stage 0 with React and Webpack
- React-Loadable SSR with Webpack 4 and Babel 7
- Unicode characters not showed when bundling and deploying React app with webpack and babel
- Unable to expose a component library in react with webpack and babel
- Webpack with JavaScript, React and jest gives Babel Error
- React Component not loading with Webpack and Babel Beginner's level
- Not load images with webpack and react in SSR
- Compiling React with Webpack 4.x and Babel 8.x
- Uncaught ReferenceError: process is not defined error when converting react (TS) app to PWA with webpack and babel config
- SCRIPT1006: Expected '() React app with webpack and Babel
- Add Favicon with React and Webpack
- How to import CSS modules with Typescript, React and Webpack
- Why does React require Babel and Webpack to work?
- Syntax error in IE11 with Webpack, Babel and React
- Remove unused css with React and Webpack
- Webpack 4 and react loadable does not seems to create correct chunk for server side rendering
- Using React Router with CDN and without webpack or browserify
- Setting up Airbnb ESLint with React and Webpack
- 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
- Wow.js with webpack and react
- Using webpack with babel and babel-preset-react and babel-preset-es2015
- the pros and const of react ssr with code splitting and now React.Lazy
- ssr with react and express and requiring stats.json explanation
- React and typescript with webpack typing issue
- Installing Babel to use with React and JSX
- Single React Component rendering with Babel Standalone with only index.html and Component
- CSS Code Splitting with Webpack 2 and React Router
- Using webpack and react × becomes × with minification
- SCRIPT1002: Syntax error in IE11 with React + Babel + Webpack
More Query from same tag
- React Transition Group V2 skipping the entering/exiting status
- How to use React-router with {this.props.children}
- Map nested JSON object in React
- setState from an API response using superagent and React
- I can't map through the array 'products'(React/Redux)
- How can I get state data inside React Actions Redux?
- React native pass to renderItem custom components?
- JSON api data not loading in React
- useEffect not rendering before getting to return
- Change the link colors in Material UI Sidebar (Drawer) in a Reactjs app
- How to prevent a whole list from re-rendering when editing an element on the list?
- AmCharts4 disable radar chart resize/zoom
- Fix Material-UI Right Side Persistent Drawer Animation
- How can I activate tooltip only when ellipsis?
- ReactJs, How to give to Axios my Token for retriving data from API
- React is showing "Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render"
- Button click gives error message if input field is empty in react hooks
- Functions are not valid as a React child. The app runs correctly but getting the warning anyway
- Update child selects
- Syntax issue with using Multer in Node.js
- React {useState, useEffect). How often React renders with single "useEffect", which triggers a 'setState' in a callback?
- How to change the hover color of Material-UI table?
- image doesn't show up on the web (React)
- React get Array from external .js that loaded async
- How to access a child's state in React
- How to make responsive React bootstrap cards that are vertically aligned?
- Writing Fragments for Polymorphic Associations in RelayJS and GraphQL
- How to call multiple ajax at same time (and get results asychronous) in ReactJS?
- How to create a JSDoc of ref when using React.fowardRef and useImperativeHandle?
- Redux - modifying state of a nested array of objects