vue-cli: Terser TypeError: Cannot read property 'minify' of undefined
Version
3.4.0
Reproduction link
https://github.com/Skyline124/flaskregul2.git
Environment info
System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Binaries:
Node: 11.9.0 - /usr/bin/node
Yarn: Not Found
npm: 6.5.0 - /usr/bin/npm
Browsers:
Chrome: Not Found
Firefox: 65.0
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.4.0
Steps to reproduce
Installation of latest NodeJS version
curl -sL https://deb.nodesource.com/setup_11.x | sudo bash -
sudo apt install nodejs
vue-cli installation
sudo npm install -g @vue/cli
creation of the example by default application
vue create flaskregul2
cd flaskregul2
npm run build
What is expected?
Build is expected to finish successfully.
What is actually happening?
Build produces the following errors :
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm@6.5.0
3 info using node@v11.9.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle flaskregul2@0.1.0~prebuild: flaskregul2@0.1.0
6 info lifecycle flaskregul2@0.1.0~build: flaskregul2@0.1.0
7 verbose lifecycle flaskregul2@0.1.0~build: unsafe-perm in
lifecycle true
8 verbose lifecycle flaskregul2@0.1.0~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/gregoire/flaskregul2/node_modules/.bin:/home/gregoire/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle flaskregul2@0.1.0~build: CWD: /home/gregoire/flaskregul2
10 silly lifecycle flaskregul2@0.1.0~build: Args: [ '-c', 'vue-cli-service build' ]
11 silly lifecycle flaskregul2@0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle flaskregul2@0.1.0~build: Failed to exec build script
13 verbose stack Error: flaskregul2@0.1.0 build: `vue-cli-service build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:197:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:197:13)
13 verbose stack at maybeClose (internal/child_process.js:978:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid flaskregul2@0.1.0
15 verbose cwd /home/gregoire/flaskregul2
16 verbose Linux 4.15.0-43-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v11.9.0
19 verbose npm v6.5.0
20 error code ELIFECYCLE
21 error errno 1
22 error flaskregul2@0.1.0 build: `vue-cli-service build`
22 error Exit status 1
23 error Failed at the flaskregul2@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I do not succeed to build the default app from your website into production. It seems that Terser is not processing the files properly but I am not able to identify the precise issue…
Any help would be appreciated!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 20
- Comments: 24 (3 by maintainers)
Commits related to this issue
- fix: ビルドが失敗する不具合の修正 現在以下のissueが上がっている https://github.com/vuejs/vue-cli/issues/3407 コメント内にあるように、`terser: 3.14.1`をインストールして対策 — committed to ryou/css-scroll-properties-test by ryou 5 years ago
- Hotfix build fails refs: https://github.com/vuejs/vue-cli/issues/3407#issuecomment-459985313 — committed to misskey-dev/misskey by acid-chicken 5 years ago
- Fix minify undefined https://github.com/vuejs/vue-cli/issues/3407 — committed to megos/event-finder by megos 5 years ago
- 🚑 fix terser bug see: https://github.com/vuejs/vue-cli/issues/3407#issuecomment-459985313 — committed to Pittan/daily-cocoda-01-impl by Pittan 5 years ago
- lib: temporary workaround as terser v3.16 is buggy (https://github.com/vuejs/vue-cli/issues/3407#issuecomment-459985313) Signed-off-by: daviddalbusco <david.dalbusco@outlook.com> — committed to deckgo/starter-kit by peterpeterparker 5 years ago
- lib: temporary workaround as terser v3.16 is buggy (https://github.com/vuejs/vue-cli/issues/3407#issuecomment-459985313) — committed to deckgo/demo by peterpeterparker 5 years ago
- Downgrade webpack to 4.3.0 and terser 3.14.1 Resolves: https://github.com/vuejs/vue-cli/issues/3407 — committed to RobKenis/rob-kenis-dot-com by RobKenis 5 years ago
- downgrade terser which has a bug related: https://github.com/vuejs/vue-cli/issues/3407 — committed to BuildTeamDev/tokenbb-web-client by marvin-bitterlich 5 years ago
- Add package-lock.json Fix issue on build (terser 3.16 is bugged, see https://github.com/vuejs/vue-cli/issues/3407#issuecomment-459985313) — committed to nioc/own-my-money by nioc 5 years ago
- Resolve Issue https://github.com/vuejs/vue-cli/issues/3407 — committed to mathssyfy/acadetech-gridsome-site by DavidCouronne 5 years ago
- fix(build): terser minify error https://github.com/vuejs/vue-cli/issues/3407 — committed to coderplanets/coderplanets_web by mydearxym 5 years ago
- temp build fix for https://github.com/vuejs/vue-cli/issues/3407 — committed to kemcho/finance-guru-site by deleted user 5 years ago
- fix(build): terser minify error https://github.com/vuejs/vue-cli/issues/3407 — committed to coderplanets/coderplanets_web by mydearxym 5 years ago
- fix https://github.com/vuejs/vue-cli/issues/3407 — committed to kemcho/finance-guru-site by deleted user 5 years ago
- Resolve to terser@3.14.1 See: * https://github.com/terser-js/terser/issues/251 * https://github.com/vuejs/vue-cli/issues/3407 — committed to ubclaunchpad/pinpoint by bobheadxi 5 years ago
- Resolve to terser@3.14.1 See: * https://github.com/terser-js/terser/issues/251 * https://github.com/vuejs/vue-cli/issues/3407 — committed to ubclaunchpad/pinpoint by bobheadxi 5 years ago
- Lock Terser version Due to https://github.com/vuejs/vue-cli/issues/3407 — committed to bolt/core by JarJak 5 years ago
- Add terser@3.14.1 into resoution due https://github.com/vuejs/vue-cli/issues/3407 — committed to cloudlinux/imunify360-doc-test by telepenin 5 years ago
- Add temporary fix for failing JS build Pin version number of a dependency. See https://github.com/vuejs/vue-cli/issues/3407 When that issue is resolved, revert this. — committed to wmde/fundraising-application by gbirke 5 years ago
- Pakotetaan vanhempi terserin versio: uudessa on jukaisun jälkeen löytynyt bugi. https://github.com/vuejs/vue-cli/issues/3407 — committed to tzrissan/mc-event-log by solita-tuomori 5 years ago
A bug in terser 3.16 which was released hours ago. For npm users: run
npm i terser@3.14For yarn users: add the following field to package.json and then rerunyarn:Both
terserandterser-webpack-pluginhave released a new patch version to address this issue. Please delete your lockfile andnode_modulesand reinstall the deps.If there’s any further problems please open a new issue with a corresponding reproduction.
This is not a bug. Maintainer is aware. But he just likes default exports so the whole world needs to get deal with it from now on
https://twitter.com/swyx/status/1091959223406084096
Looks like we have mad scientist case here. I can’t explain such Egoism otherwise.
@raymondware Should be (working for me) enough for Yarn. And of
rm -rf node_modules yarn.lockInstalling terser@3.14.1 didn’t resolve the issue for me. I had to downgrade Webpack as mentioned by @carltierney to 4.2.0.
See https://github.com/terser-js/terser/issues/251
Installing
terser@3.14fixed the issue for me.If building your app in Docker when deploying, don’t forget to remove the
^in front of yourterserdependency in yourpackage.jsonto stop it from installing the affected version when the container is built. This tripped me up when I tried re-deploying after installing3.14.The workarounds do not work for me… could you guys just revert this? You really are impeding progress on my development of my app for Fitbit. Or alternatively when is the fix coming out? This is not only affecting vue.js but also react.js and the Fitbit SDK
npm install terser@3.14
For me it was necessary to add it to the yml file for building it to production in Bitbucket.
Adding it to just my package.json didn’t work.
If using Yarn,
yarn add terser@3.14then removingnode_modulesfolder. Lastly runyarnrunning
npm install terser@3.14worked for me too. thanks @tetreault !doing
npm install terser@3.14fixed this on my end thanks allwe just downgraded to webpack 4.2 to avoid the use of terser which also worked.