Vuepress: 0.14.8: vuepress build just failed

Created on 2 Feb 2019  路  12Comments  路  Source: vuejs/vuepress




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




Bug report

Version

0.14.8

Steps to reproduce

I'm following getting started steps from official home page guide

also I have tried use npm way:

$ npm rm -g vuepress
$ npm i -g vuepress
$ vuepress -V
0.14.8
$ mkdir npm-vuepress-app
$ cd npm-vuepress-app/
$ echo '# test' > README.md
$ vuepress build

What is actually happening?

vuepress build command is failing

vuepress build

 WAIT  Extracting site metadata...
[8:32:30 PM] Compiling Client
[8:32:30 PM] Compiling Server
[8:32:33 PM] Compiled Server in 3s
[8:32:33 PM] Compiled Client in 3s
(undefined) assets/js/styles.348a8abd.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
    at module.exports (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
    at handle (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:44:8)
    at process.<anonymous> (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:51:3)
    at process.emit (events.js:189:13)
    at emit (internal/child_process.js:820:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(undefined) assets/js/app.7b8bf325.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
    at module.exports (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
    at handle (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:44:8)
    at process.<anonymous> (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:51:3)
    at process.emit (events.js:189:13)
    at emit (internal/child_process.js:820:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(undefined) assets/js/2.c715a618.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
    at module.exports (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
    at handle (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:44:8)
    at process.<anonymous> (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:51:3)
    at process.emit (events.js:189:13)
    at emit (internal/child_process.js:820:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(undefined) assets/js/3.f4e2b70b.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
    at module.exports (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
    at handle (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:44:8)
    at process.<anonymous> (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:51:3)
    at process.emit (events.js:189:13)
    at emit (internal/child_process.js:820:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(undefined) assets/js/4.8140a824.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
    at module.exports (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
    at handle (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:44:8)
    at process.<anonymous> (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/worker-farm/lib/child/index.js:51:3)
    at process.emit (events.js:189:13)
    at emit (internal/child_process.js:820:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Error: Failed to compile with errors.
    at webpack (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/lib/build.js:113:18)
    at finalCallback (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/MultiCompiler.js:247:12)
    at runWithDependencies.err (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/MultiCompiler.js:270:6)
    at done (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/neo-async/async.js:2928:13)
    at runCompilers (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/MultiCompiler.js:174:48)
    at err (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/MultiCompiler.js:181:7)
    at compiler.run (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/MultiCompiler.js:263:7)
    at finalCallback (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/Compiler.js:220:39)
    at hooks.done.callAsync.err (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/Compiler.js:236:13)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:33:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/tapable/lib/Hook.js:154:20)
    at onCompiled (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/Compiler.js:234:21)
    at hooks.afterCompile.callAsync.err (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/Compiler.js:630:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/tapable/lib/Hook.js:154:20)
    at compilation.seal.err (/Users/mak/.nvm/versions/node/v10.15.1/lib/node_modules/vuepress/node_modules/webpack/lib/Compiler.js:627:30)

Other relevant information

  • Your OS: MacOS 10.14.3
  • Node.js version: v10.15.1
  • Is this a global or local install? failed for both cases: globally and locally
  • Which package manager did you use for the install? failed for npm and for yarn

Most helpful comment

A bug in terser 3.16 which was released hours ago.

For npm users run:
npm i [email protected] -g

For yarn users: add the following field to package.json and then rerun yarn:

"resolutions": {
  "terser": "3.14.1"
}

Refs:

All 12 comments

Hi again,

I also switched on latest Node (v11.9.0) and 8 nvm use 8 --lts each time reinstalled vuepress too, but vuepres build command still failing similary like with Node LTS (v10.15.1).


Regards,
Maksim

I confirm the same error.
Interestingly, it appeared after today's fresh npm install.
Yesterday the project was being built correctly

As a workarround, I temporarily changed dependency on webpack from ""^4.8.1" to ""4.8.1" and build run properly

Hello @sjbat,

As a workarround, I temporarily changed dependency on webpack from ""^4.8.1" to ""4.8.1" and build run properly

Can you be more specific?
Do you mean directly somewhere in node_modules/ folder?

Interestingly, it appeared after today's fresh npm install.

Well, that is way I'm always freezing exact dependencies version in all my projects..

In my project package.json I added strict webpack dependency on specific version "4.8.1"

"devDependencies": {
    "vuepress": "0.14.5",
    "webpack": "4.8.1"
  },

Same problem here with a clean installation from today.

As a workaround, I was able to _patch_ the global installation of vuepress with the change suggested by @sjbat (thanks!) by changing "webpack": "^4.8.1", to "webpack": "4.8.1", in /usr/local/lib/node_modules/vuepress/package.json ("dependencies" section) and running npm install in that directory (/usr/local/lib/node_modules/vuepress/).

After this _patch_ I am able build my vuepress site without any problems.

I have investigated little bit and found, that last worked webpack dependency in that case is
"webpack": "4.25.1", everything after (since 4.26.0+) doesn't work.
Seems like root cause in some transitive dependency...

A bug in terser 3.16 which was released hours ago.

For npm users run:
npm i [email protected] -g

For yarn users: add the following field to package.json and then rerun yarn:

"resolutions": {
  "terser": "3.14.1"
}

Refs:

UPDATE: It builds now!

Still the same thing here :(

(undefined) assets/js/styles.7ddf6dbb.js from Terser
 TypeError: Cannot read property 'minify' of undefined
    at minify (/usr/local/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
    at module.exports (/usr/local/lib/node_modules/vuepress/node_modules/terser-webpack-plugin/dist/worker.js:13:40)

I'm using yarn and here is my package.json

{
  "devDependencies": {
    "node-sass": "^4.11.0",
    "sass-loader": "^7.1.0"
  },
  "resolutions": {
      "terser": "3.14.1"
    }
}

@ulivz 馃憤

A general question, when do you think the current vuepress will goes to Beta Release?
Or, how much confidence do we have to put current latest version into large scale production?

@ulivz: Please leave the comment when this problem was solved, so we can remove workaround code. Thanks!

We can close this issue for now, and all the users met this error should re-install your deps:

  • For npm users, exec npm update
  • For yarn users, exec yarn upgrade
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ynnelson picture ynnelson  路  3Comments

ederchrono picture ederchrono  路  3Comments

cfjedimaster picture cfjedimaster  路  3Comments

AleksejDix picture AleksejDix  路  3Comments

ynnelson picture ynnelson  路  3Comments