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
- I can't update my string value with React hooks
- Pass data (prop) from _app.js to getServerSideProps in a page - NextJS, latest version
- How to update data in the child component by click event in the parent component
- filter array of objects not returning filtered values
- Is it possible to pass a React Component as argument in between functions of a Container Component
- How do I configure my package.json file to read from an env var set in my OS?
- React Hook useState Not Updating UI
- Persistent focus in NextJS
- Radium-React reports "please wrap your application in the StyleRoot component" when using MediaQuery
- How to change CSS in onChange typeScript?
- if statement not returning as an object React JS
- Can't load font-awesome with Webpack
- Sending requests to Elasticsearch with axios
- Attempting to access data after fetching with custom hook not working
- Call function only in specific state in React with Hooks
- Changing attribute in state React.js
- How to set React.useState based on URL
- AWS amplify deploy failure due to aws-exports
- Nuka Carousel heightMode don't work in react
- Method for coverting all Firestore Timestamps in a snapshot to JS dates?
- React: Redux state updated in one effect but next effect in same component is using previous value of state
- Setting Content-Type in fetch request not working
- save data from many forms using getFieldValue()
- Unable to integrate create-react-app with Three.js
- How to access one component's state from another component
- Testing click event in React Testing Library
- React route if user hasn't confirmed email
- Why my last if statement in React.js doesn't work? I'm using jsx
- react-router: How do I update the url without causing a navigation/reload?
- bootstrap list group onclick not working created through reactjs