vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.43k stars 4.79k forks source link

Class constructor LRUCache cannot be invoked without 'new' #1674

Open znat opened 5 years ago

znat commented 5 years ago

Bug report

Building on netlify will return this error: Class constructor LRUCache cannot be invoked without 'new'

Steps to reproduce

Build the the vuepress site with official instructions on Netlify

What is expected?

Doc should be built succesfully

What is actually happening?

Class constructor LRUCache cannot be invoked without 'new'

Other relevant information

2:52:03 AM: Build ready to start
2:52:05 AM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12
2:52:05 AM: build-image tag: v2.8.2
2:52:05 AM: buildbot version: 1c5d5da2a8a19e94f07a53f82f5c9b010bad1249
2:52:05 AM: Fetching cached dependencies
2:52:05 AM: Starting to download cache of 182.7MB
2:52:06 AM: Finished downloading cache in 1.394904231s
2:52:06 AM: Starting to extract cache
2:52:13 AM: Finished extracting cache in 6.946429391s
2:52:13 AM: Finished fetching cache in 8.436709263s
2:52:13 AM: Starting to prepare the repo for build
2:52:14 AM: Preparing Git Reference refs/heads/master
2:52:16 AM: Starting build script
2:52:16 AM: Installing dependencies
2:52:17 AM: Started restoring cached node version
2:52:19 AM: Finished restoring cached node version
2:52:20 AM: v10.16.0 is already installed.
2:52:21 AM: Now using node v10.16.0 (npm v6.9.0)
2:52:21 AM: Attempting ruby version 2.6.2, read from environment
2:52:23 AM: Using ruby version 2.6.2
2:52:23 AM: Using PHP version 5.6
2:52:23 AM: Started restoring cached node modules
2:52:23 AM: Finished restoring cached node modules
2:52:23 AM: Installing NPM modules using NPM version 6.9.0
2:52:40 AM: > botfront@0.15.0-rc.0 postinstall /opt/build/repo/botfront
2:52:40 AM: > cp -R node_modules/semantic-ui-css/themes/default/assets/fonts ./public/
2:52:42 AM: npm WARN
2:52:42 AM:  ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
2:52:42 AM: npm WARN rasa-webchat@0.5.8 requires a peer of react@^15.6.1 but none is installed. You must install peer dependencies yourself.
2:52:42 AM: npm WARN react-dom@15.6.2 requires a peer of react@^15.6.2 but none is installed. You must install peer dependencies yourself.
2:52:42 AM: npm
2:52:42 AM: WARN react-immutable-proptypes@2.1.0 requires a peer of immutable@>=3.6.2 but none is installed. You must install peer dependencies yourself.
2:52:42 AM: npm
2:52:42 AM:  WARN uniforms@1.31.1 requires a peer of graphql@^14.0.0 || 0.8.0 - 14.0.0 but none is installed. You must install peer dependencies yourself.
2:52:42 AM: removed 408 packages, updated 14 packages and audited 27652 packages in 18.192s
2:52:42 AM: found 3 high severity vulnerabilities
2:52:42 AM:   run `npm audit fix` to fix them, or `npm audit` for details
2:52:42 AM: NPM modules installed
2:52:43 AM: Started restoring cached go cache
2:52:43 AM: Finished restoring cached go cache
2:52:43 AM: unset GOOS;
2:52:43 AM: unset GOARCH;
2:52:43 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
2:52:43 AM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
2:52:43 AM: go version >&2;
2:52:43 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
2:52:43 AM: go version go1.12 linux/amd64
2:52:43 AM: Installing missing commands
2:52:43 AM: Verify run directory
2:52:43 AM: Executing user command: npm run docs:build
2:52:43 AM: > botfront@0.15.0-rc.0 docs:build /opt/build/repo/botfront
2:52:43 AM: > vuepress build docs
2:52:43 AM: /opt/build/repo/botfront/node_modules/vuepress/lib/util/index.js:57
2:52:43 AM: const cache = LRU({ max: 1000 })
2:52:43 AM:               ^
2:52:43 AM: TypeError: Class constructor LRUCache cannot be invoked without 'new'
2:52:43 AM:     at Object.<anonymous> (/opt/build/repo/botfront/node_modules/vuepress/lib/util/index.js:57:15)
2:52:43 AM:     at Module._compile (internal/modules/cjs/loader.js:776:30)
2:52:43 AM:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2:52:43 AM:     at Module.load (internal/modules/cjs/loader.js:653:32)
2:52:43 AM:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2:52:43 AM:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2:52:43 AM:     at Module.require (internal/modules/cjs/loader.js:690:17)
2:52:43 AM:     at require (internal/modules/cjs/helpers.js:25:18)
2:52:43 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
2:52:43 AM:     at Object.<anonymous> (/opt/build/repo/botfront/node_modules/vuepress/lib/index.js:4:24)
2:52:43 AM:     at Module._compile (internal/modules/cjs/loader.js:776:30)
2:52:43 AM: npm
2:52:43 AM:  ERR! code ELIFECYCLE
2:52:43 AM: npm
2:52:43 AM: ERR! errno 1
2:52:43 AM: npm
2:52:43 AM: ERR!
2:52:43 AM:  botfront@0.15.0-rc.0 docs:build: `vuepress build docs`
2:52:43 AM: npm
2:52:43 AM: ERR! Exit status 1
2:52:43 AM: npm
2:52:43 AM: ERR!
2:52:43 AM: npm
2:52:43 AM:  ERR! Failed at the botfront@0.15.0-rc.0 docs:build script.
2:52:43 AM: npm
2:52:43 AM:  ERR! This is probably not a problem with npm. There is likely additional logging output above.
2:52:43 AM: npm
2:52:43 AM: ERR! A complete log of this run can be found in:
2:52:43 AM: npm ERR!     /opt/buildhome/.npm/_logs/2019-06-23T06_52_43_709Z-debug.log
2:52:43 AM: Skipping functions preparation step: no functions directory set
2:52:43 AM: Caching artifacts
2:52:43 AM: Started saving node modules
2:52:43 AM: Finished saving node modules
2:52:43 AM: Started saving pip cache
2:52:43 AM: Finished saving pip cache
2:52:43 AM: Started saving emacs cask dependencies
2:52:43 AM: Finished saving emacs cask dependencies
2:52:43 AM: Started saving maven dependencies
2:52:43 AM: Finished saving maven dependencies
2:52:43 AM: Started saving boot dependencies
2:52:43 AM: Finished saving boot dependencies
2:52:43 AM: Started saving go dependencies
2:52:44 AM: Shutting down logging, 4 messages pending

Usage: $ vuepress [options]

Commands: dev [targetDir] start development server build [targetDir] build dir as static site eject [targetDir] copy the default theme into .vuepress/theme for customization. info Shows debugging information about the local environment

For more info, run any command with the --help flag: $ vuepress dev --help $ vuepress build --help $ vuepress eject --help $ vuepress info --help

Options: -v, --version Display version number -h, --help Display this message

ulivz commented 4 years ago

Could you also use LRU cache library in your docs's site and it's incompatible to the LRU cache used by VuePress?