Webpack4.x failed to configure babel build, error Unknown substitution "BODY" given

configure babel-loader in webpack.config.js

    ERROR in ./src/core/index.js
Module build failed (from ./node_modules/_babel-loader@8.0.2@babel-loader/lib/index.js):
Error: Unknown substitution "BODY" given
    at Object.keys.forEach.key (E:\global\develop\visitor-next\node_modules\_@babel_template@7.0.0@@babel\template\lib\populate.js:35:15)
    at Array.forEach (<anonymous>)
    at populatePlaceholders (E:\global\develop\visitor-next\node_modules\_@babel_template@7.0.0@@babel\template\lib\populate.js:33:31)
    at arg (E:\global\develop\visitor-next\node_modules\_@babel_template@7.0.0@@babel\template\lib\string.js:22:51)
    at arg (E:\global\develop\visitor-next\node_modules\_@babel_template@7.0.0@@babel\template\lib\builder.js:77:14)
    at spec (E:\global\develop\visitor-next\node_modules\_babel-plugin-transform-es2015-for-of@6.23.0@babel-plugin-transform-es2015-for-of\lib\index.js:171:20)

ask God for advice, is there any plug-in missing?

Jun.28,2021

babel-core is it installed


Thank you. The answer has been found. To install babel-loader@8 version, core and preset-env need version 7 or above

clipboard.png needs to install two

in the diagram
Menu