vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.48k stars 4.78k forks source link

@babel/preset-env: The plugins/built-ins 'es.array.iterator, es.promise, es.object.assign, es.promise.finally' passed to the 'exclude' option are not valid. #2838

Open xon52 opened 3 years ago

xon52 commented 3 years ago

Bug report

Every time I try and dev or build my docs, I get the following error:

Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: [BABEL] D:\Dropbox\Projects\test\node_modules\@vuepress\core\lib\client\clientEntry.js: @babel/preset-env: The plugins/built-ins 'es.array.iterator, es.promise, es.object.assign, es.promise.finally' passed to the 'exclude' option are not
    valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env (While processing: "D:\\Dropbox\\Projects\\test\\node_modules\\@vue\\babel-preset-app\\index.js.overrides[0]$0")
    at OptionValidator.invariant (D:\Dropbox\Projects\test\node_modules\@babel\helper-validator-option\lib\validator.js:48:13)
    at expandIncludesAndExcludes (D:\Dropbox\Projects\test\node_modules\@babel\preset-env\lib\normalize-options.js:51:5)
    at normalizeOptions (D:\Dropbox\Projects\test\node_modules\@babel\preset-env\lib\normalize-options.js:130:19)
    at D:\Dropbox\Projects\test\node_modules\@babel\preset-env\lib\index.js:277:37
    at D:\Dropbox\Projects\test\node_modules\@babel\helper-plugin-utils\lib\index.js:22:12
    at async (D:\Dropbox\Projects\test\node_modules\@babel\core\lib\gensync-utils\async.js:33:33)
    at async (D:\Dropbox\Projects\test\node_modules\gensync\index.js:186:15)
    at D:\Dropbox\Projects\test\node_modules\gensync\index.js:216:13
    at Generator.next (<anonymous>)
    at D:\Dropbox\Projects\test\node_modules\@babel\core\lib\config\full.js:213:21
    at Generator.next (<anonymous>)

Steps to reproduce

Check out my x5-gmaps repo, and run npm run docs:dev (and open up the localhost link), or npm run docs:build. You can also see the failed Github Pages build.

What is expected?

No errors and docs displaying/building.

What is actually happening?

Errors and no docs displaying/building.

Other relevant information

EwertonDCSilv commented 2 years ago

I have the same problem !

shijunti19 commented 11 months ago

me too

baixiaoji commented 9 months ago

所以这个有解决方案吗

baixiaoji commented 9 months ago

所以这个有解决方案吗

如果安装 @vue/babel-preset-app 导致这个问题,将版本和@vue/babel-x 的包的版本对齐就可以解决