Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

441
Views
webpack + react building get babel error,Module build failed (from ./node_modules/babel-loader/lib/index.js):
ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: Cannot read property 'next' of undefined
    at evaluateSync (/Users/zhanghanfeng/Desktop/testrrw/node_modules/gensync/index.js:251:28)
    at /Users/zhanghanfeng/Desktop/testrrw/node_modules/gensync/index.js:31:34
    at Array.map (<anonymous>)
    at Function.sync (/Users/zhanghanfeng/Desktop/testrrw/node_modules/gensync/index.js:31:22)
    at Function.all (/Users/zhanghanfeng/Desktop/testrrw/node_modules/gensync/index.js:210:24)
    at Generator.next (<anonymous>)
    at createDescriptors (/Users/zhanghanfeng/Desktop/testrrw/node_modules/@babel/core/lib/config/config-descriptors.js:142:41)
    at createDescriptors.next (<anonymous>)
    at createPresetDescriptors (/Users/zhanghanfeng/Desktop/testrrw/node_modules/@babel/core/lib/config/config-descriptors.js:134:17)
    at createPresetDescriptors.next (<anonymous>)

here is my set

webpack.config.js

module.exports = {
    entry:'./src/index.js',
    mode: 'production',
    output:{
        filename:'[name].js',
        path:__dirname+'/dist'
    },
    module:{
        rules:[
            {
                test: /\.m?js$/,
                exclude: /node_modules/,
                use:{
                    loader: 'babel-loader'
                } 
            },
            // { test: /\.ts$/,exclude: /node_modules/, use: 'ts-loader' },
            {
                test: /\.css$/i,
                exclude: /node_modules/,
                use: ["style-loader", "css-loader", "postcss-loader"],
              },
        ]
    }
}

babel.config.js

module.exports = function (api) {
  var env = api.cache(() => process.env.NODE_ENV);
  return {
    presets: [require("@babel/preset-env"), , require("@babel/preset-react")],
    plugins: [
        [
          require('@babel/plugin-transform-runtime'),
          {
            corejs: {version: 3, proposals: true},
            helpers: true,
            useESModules: true,
            regenerator: true,
            absoluteRuntime: "./node_modules"
          }
        ]      
    ],
  };
};

here is the github link : https://github.com/mxm-web-develop/issues I'm trying to figure out the basic relate of react, babel, rollup or webpack. the babel translate problem also happen in rollup build, anyone any explain the problem and help me fix the error?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!