vuepress icon indicating copy to clipboard operation
vuepress copied to clipboard

@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.

Open xon52 opened this issue 4 years ago • 4 comments

  • [x] I confirm that this is an issue rather than a question.

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

  • I have had this once before and I don't even know what changed to fix it.

  • If I put @vue/babel-preset-app as a babel preset in a regular project I get the same error (for that project)

  • I have testing updating VuePress to v1.8.2 without any change in the result.

  • Output of npx vuepress info in my VuePress project:

Environment Info:

  System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz
  Binaries:
    Node: 15.12.0 - D:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - D:\Program Files\Yarn\bin\yarn.CMD
    npm: 7.6.3 - D:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 90.0.4430.93
    Edge: Spartan (44.18362.1474.0)
  npmPackages:
    @vuepress/core:  1.8.2
    @vuepress/theme-default:  1.8.2
    vuepress: ^1.5.3 => 1.8.2
  npmGlobalPackages:
    vuepress: Not Found

xon52 avatar May 03 '21 04:05 xon52

I have the same problem !

EwertonDCSilv avatar Jan 19 '22 20:01 EwertonDCSilv

me too

shijunti19 avatar Oct 11 '23 12:10 shijunti19

所以这个有解决方案吗

baixiaoji avatar Dec 03 '23 09:12 baixiaoji

所以这个有解决方案吗

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

baixiaoji avatar Dec 03 '23 09:12 baixiaoji