vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.32k forks source link

yarn serve :Module build failed (from ./node_modules/babel-loader/lib/index.js): #3200

Closed xiaomizhou66 closed 5 years ago

xiaomizhou66 commented 5 years ago

Version

3.2.1

Environment info

win7

Steps to reproduce

yarn serve

What is expected?

yarn serve

What is actually happening?

error

### Version
3.2.1

### Environment info

win7



### Steps to reproduce
yarn serve

### What is expected?
yarn serve

### What is actually happening?
error

<!-- generated by vue-issues. DO NOT REMOVE -->
xiaomizhou66 commented 5 years ago
λ yarn serve
yarn run v1.12.3
$ vue-cli-service serve
 INFO  Starting development server...
 94% after seal

 ERROR  Failed to compile with 1 errors                                                                                                                         14:56:33

 error  in ./src/main.js

Module build failed (from ./node_modules/babel-loader/lib/index.js):
ReferenceError: [BABEL] F:\qianduan_dir\00program\web-vue-cli3\todo-\src\main.js: Unknown option: .polyfills. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
    at throwUnknownError (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\validation\options.js:123:11)
    at Object.keys.forEach.key (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\validation\options.js:107:5)
    at Array.forEach (<anonymous>)
    at validateNested (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\validation\options.js:83:21)
    at validate (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\validation\options.js:74:10)
    at instantiatePreset (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:244:36)
    at cachedFunction (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\caching.js:33:19)
    at loadPresetDescriptor (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:235:45)
    at config.presets.reduce (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:77:21)
    at Array.reduce (<anonymous>)
    at recurseDescriptors (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:74:38)
    at loadFullConfig (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:108:6)
    at process.nextTick (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\transform.js:28:33)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

 @ multi (webpack)-dev-server/client?http://192.168.2.103:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
haoqunjiang commented 5 years ago

I guess it's a duplicate of https://github.com/vuejs/vue-cli/issues/2938#issuecomment-437896185

Next time please provide a reproduction repo. Without actual runnable code we can't help you much.