generator-jhipster: TypeError when building with prod profile

Overview of the issue

Error building project with “prod” profile:

➜  21-points git:(master) ✗ ./gradlew -Pprod

> Task :yarn_install
yarn install v1.5.1
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@0.5.x"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.3"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@0.1.x"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.3"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@~0.4.1"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@0.5.x"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.7"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@~0.5.1"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.4.2"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.3"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@~0.5.0"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.3"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.1"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@~0.2.0"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.4.4"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.1.41"
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.4.2"
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > bootstrap@4.0.0" has unmet peer dependency "popper.js@^1.12.9".
[5/5] Building fresh packages...
success Saved lockfile.
$ webdriver-manager update && node node_modules/phantomjs-prebuilt/install.js
[17:50:11] I/file_manager - creating folder /Users/andre/work/21-points/node_modules/webdriver-manager/selenium
[17:50:12] I/update - chromedriver: unzipping chromedriver_2.35.zip
[17:50:13] I/update - chromedriver: setting permissions to 0755 for /Users/andre/work/21-points/node_modules/webdriver-manager/selenium/chromedriver_2.35
[17:50:15] I/update - geckodriver: unzipping geckodriver-v0.19.1.tar.gz
[17:50:15] I/update - geckodriver: setting permissions to 0755 for /Users/andre/work/21-points/node_modules/webdriver-manager/selenium/geckodriver-v0.19.1
Found PhantomJS at /Users/andre/work/21-points/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ...verifying
PhantomJS is previously installed at /Users/andre/work/21-points/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
Done in 18.17s.

> Task :webpack
yarn run v1.5.1
$ yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www
$ rimraf build/{aot,www}
$ yarn run webpack -- --config webpack/webpack.prod.js --profile
warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.
$ node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config webpack/webpack.prod.js --profile
MergetJsonsWebpackPlugin compilation started...
MergetJsonsWebpackPlugin compilation completed...
buffer.js:202
  throw new TypeError(kFromErrorMsg);
  ^

TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
    at Function.Buffer.from (buffer.js:202:9)
    at new Buffer (buffer.js:158:17)
    at writeOut (/Users/andre/work/21-points/node_modules/webpack/lib/Compiler.js:334:17)
    at require.forEach (/Users/andre/work/21-points/node_modules/webpack/lib/Compiler.js:345:12)
    at /Users/andre/work/21-points/node_modules/async/dist/async.js:3096:16
    at eachOfArrayLike (/Users/andre/work/21-points/node_modules/async/dist/async.js:1055:9)
    at eachOf (/Users/andre/work/21-points/node_modules/async/dist/async.js:1103:5)
    at Object.eachLimit (/Users/andre/work/21-points/node_modules/async/dist/async.js:3158:5)
    at emitFiles (/Users/andre/work/21-points/node_modules/webpack/lib/Compiler.js:315:21)
    at /Users/andre/work/21-points/node_modules/mkdirp/index.js:30:20
    at FSReqWrap.oncomplete (fs.js:135:15)
error An unexpected error occurred: "Command failed.
Reproduce the error

Follow the jhipster mini-book. I just created a new project and ran that command.

JHipster Version(s)
JHipster configuration

Using JHipster version installed locally in current project’s node_modules Executing jhipster:info Options: Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
twenty-one-points@0.0.0 /Users/andre/work/21-points
└── generator-jhipster@4.14.0

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "org.jhipster.health",
      "nativeLanguage": "pt-pt"
    },
    "jhipsterVersion": "4.14.0",
    "baseName": "TwentyOnePoints",
    "packageName": "org.jhipster.health",
    "packageFolder": "org/jhipster/health",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "replaced-by-jhipster-info",
    "clientFramework": "angularX",
    "useSass": true,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [
      "gatling",
      "protractor"
    ],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "pt-pt",
    "languages": [
      "pt-pt",
      "en"
    ]
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions




Environment and Tools

java version “1.8.0_77” Java™ SE Runtime Environment (build 1.8.0_77-b03) Java HotSpot™ 64-Bit Server VM (build 25.77-b03, mixed mode)

git version 2.14.3 (Apple Git-98)

node: v8.9.4

npm: 5.6.0

yeoman: 2.0.1

yarn: 1.5.1

Docker version 17.12.0-ce, build c97c6d6

docker-compose version 1.18.0, build 8dd22a9

Congratulations, JHipster execution is complete!

Browsers and Operating System

MacOS High Sierra

  • Checking this box is mandatory (this is just to show you read everything)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 26 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Well that is because of workbox plugin

Can you update it to latest "workbox-webpack-plugin": "3.0.0-beta.1",

and change the webpack-prod to new WorkboxPlugin.GenerateSW({

can we release a patch version @jdubois