vuejs / vue-cli

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

build error: TypeError: Cannot read property 'minify' of undefined #3408

Closed rebeccapeltz closed 5 years ago

rebeccapeltz commented 5 years ago

Version

3.4.0

Reproduction link

https://github.com/suwebdev/wats4000-templates-and-data/tree/cli3-migrate

Environment info

Environment Info:

  System:
    OS: macOS 10.14.2
    CPU: (4) x64 Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
  Binaries:
    Node: 8.11.4 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.7.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 71.0.3578.98
    Firefox: 57.0.4
    Safari: 12.0.2
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.2 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.2 
    @vue/babel-preset-app:  3.4.0 
    @vue/babel-preset-jsx:  1.0.0-beta.2 
    @vue/babel-sugar-functional-vue:  1.0.0-beta.2 
    @vue/babel-sugar-inject-h:  1.0.0-beta.2 
    @vue/babel-sugar-v-model:  1.0.0-beta.2 
    @vue/babel-sugar-v-on:  1.0.0-beta.2 
    @vue/cli-overlay:  3.4.0 
    @vue/cli-plugin-babel: ^3.4.0 => 3.4.0 
    @vue/cli-plugin-eslint: ^3.4.0 => 3.4.0 
    @vue/cli-service: ^3.4.0 => 3.4.0 
    @vue/cli-shared-utils:  3.4.0 
    @vue/component-compiler-utils:  2.5.2 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.1.0 
    vue: ^2.5.22 => 2.5.22 
    vue-eslint-parser:  2.0.3 
    vue-hot-reload-api:  2.3.1 
    vue-loader:  15.6.2 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.5.21 => 2.5.22 
    vue-template-es2015-compiler:  1.8.2 
  npmGlobalPackages:
    @vue/cli: 3.3.0

Steps to reproduce

npm run build

What is expected?

should build to my docs directory I have been using my config files successfully on previous days

What is actually happening?

build error: TypeError: Cannot read property 'minify' of undefined

Rebeccas-MacBook-Air:wats4000-templates-and-data becky$ npm run build

hello-world@0.1.0 build /Users/becky/projects/4000/wats4000-templates-and-data vue-cli-service build

⠴ Building for production...

ERROR Failed to compile with 2 errors 09:11:37

error

assets/js/app.ed82413e.js from Terser TypeError: Cannot read property 'minify' of undefined at minify (/Users/becky/projects/4000/wats4000-templates-and-data/node_modules/terser-webpack-plugin/dist/minify.js:17 5:23) at module.exports (/Users/becky/projects/4000/wats4000-templates-and-data/node_modules/terser-webpack-plugin/dist/work er.js:13:40) at handle (/Users/becky/projects/4000/wats4000-templates-and-data/node_modules/worker-farm/lib/child/index.js:44:8) at process. (/Users/becky/projects/4000/wats4000-templates-and-data/node_modules/worker-farm/lib/child/inde x.js:51:3) at emitTwo (events.js:126:13) at process.emit (events.js:214:7) at emit (internal/child_process.js:772:12) at _combinedTickCallback (internal/process/next_tick.js:141:11) at process._tickCallback (internal/process/next_tick.js:180:9)

error

assets/js/chunk-vendors.76ce3e5a.js from Terser TypeError: Cannot read property 'minify' of undefined at minify (/Users/becky/projects/4000/wats4000-templates-and-data/node_modules/terser-webpack-plugin/dist/minify.js:175:23) at module.exports (/Users/becky/projects/4000/wats4000-templates-and-data/node_modules/terser-webpack-plugin/dist/worker.js:13:40) at handle (/Users/becky/projects/4000/wats4000-templates-and-data/node_modules/worker-farm/lib/child/index.js:44:8) at process. (/Users/becky/projects/4000/wats4000-templates-and-data/node_modules/worker-farm/lib/child/index.js:51:3) at emitTwo (events.js:126:13) at process.emit (events.js:214:7) at emit (internal/child_process.js:772:12) at _combinedTickCallback (internal/process/next_tick.js:141:11) at process._tickCallback (internal/process/next_tick.js:180:9)

ERROR Build failed with errors. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! hello-world@0.1.0 build: vue-cli-service build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the hello-world@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/becky/.npm/_logs/2019-02-02T17_11_37_442Z-debug.log Rebeccas-MacBook-Air:wats4000-templates-and-data becky$


NOTE: npm run serve works correctly I've been using version 3.3 successfully for a few weeks. Is there an easy way to upgrade to 3.4 if 3.3 is the problem?

I tried creating a new test project with no new configs and got the same build error (minify) today.

Skyline124 commented 5 years ago

Hi Rebecca! Same problem here on Linux, in the #3407 issue. npm run dev works properly for me as well :+1:

haoqunjiang commented 5 years ago

closed in favor of #3407