Generator-jhipster: TypeError when building with prod profile

Created on 27 Feb 2018  ·  26Comments  ·  Source: jhipster/generator-jhipster

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 "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "[email protected]"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.3"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "[email protected]"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.3"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@~0.4.1"
warning Resolution field "[email protected]" is incompatible with requested version "[email protected]"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.7"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@~0.5.1"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.4.2"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.3"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.6"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@~0.5.0"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.3"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.5.1"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@~0.2.0"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.4.4"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.1.41"
warning Resolution field "[email protected]" is incompatible with requested version "source-map@^0.4.2"
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > [email protected]" 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)**
[email protected] /Users/andre/work/21-points
└── [email protected]

##### **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(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 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

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

Most helpful comment

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({

All 26 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

Yes if you cherry pick this in v4 maintenance branch

You mean this is urgent? Just tell me I can do a release tonight

OK this looks like an emergency patch is needed, I'm having a look

btw this bug report isn't good, it is said you run Gradle, but in the .yo-rc.json it's configured with Maven...

I am on it

Oh thanks - I was testing but you know this far better than me -> just tell me and I'll do a release

Here we go 👍

Thanks a lot - I'll try to do a release tonight

Closing as this is merged

upgraded jhipster to 4.14.1 ...I'm on windows 10 ..still have this problem
[ERROR] warning Resolution field "source-map...

@nutrimax1987 this is not a problem, this is a warning which is wrongly logged as ERROR by maven front end plugin. About the warning itself, see https://stackoverflow.com/questions/48969907/jhipster-warnings-on-new-project-generation/48972431#48972431

thank you for quick response

Hi! I just write in another thread.
I have this problem... I am triying upgrade my jhipster version... I can not upgrade.
I did this:
first: yarn global remove generator-jhipster
then: yarn global add generator-jhipster,
result==>success Installed "[email protected]" with binaries:

  • jhipster
    Done in 6.87s.

But when i execute yo jhipster:

JHipster update available: 4.14.3 (current: 4.14.0)

Run yarn global upgrade generator-jhipster to update.

Its making me crazy....

thanks

Please don't spam us.... Follow the upgrade procedure, here you are just upgrading your global install, not the one from the project. Please also note this is the issue tracker, not a support forum.

Perdoname, pero todo esto viene en relación con el problema de ayer, relacionado con los dos hilos que me has cerrado, relacionado con un fallo en jhipster heroku.
Perdoname si te molesto, no es mi intención hacer spam.
Por supuesto que he actualizado el proyecto pero no hay forma de conseguir la subida y el error se sigue reproduciendo.
Si reporto aqui el erro es porque pienso que os puede servir de ayuda.
no estas siendo nada amable.

Please use English, so everybody can understand. If you continue spamming us and not respecting our guidelines I will block you from the project.

Forgive me, but all this comes in a relationship with the problem of yesterday, related to the two threads that I have closed, related to a failure in jhipster heroku.
Forgive me if I bother you, it is not my intention to spam.
Of course you have updated the project but there is no way to get the upload and the error keeps playing.
If I report here the error is because this problema can help you
you're not being friendly

Please, there are 700+ people watching this project, including the whole dev team, and this is only for reporting bugs.

Here you are asking for support on something which is documented on the website (for example at https://www.jhipster.tech/upgrading-an-application/ ), and which is definitely not a bug - so all I'm asking is that you follow our guidelines - there are other places like Stackoverflow or Gitter, where the team also is, and which are the correct places for support.

I'm sorry I did not explain myself well from the beginning. I apologize.
But I still think it's a bug.
I am sorry.
I'm afraid that my 200 students will be left without seeing jhipster, I will not bother you again.

@lafalangito Based on your logs I'm guessing you installed with npm originally, but the upgrade message tells you to use yarn. The npm version is used instead of the version installed by yarn (this is reproducible)

Uninstall it from both npm and yarn, then install with only one or the other.

# remove from both
npm uninstall -g generator-jhipster
yarn global remove generator-jhipster

# install with just yarn
yarn global add generator-jhipster

The correct place to ask questions like this is StackOverflow or Gitter. Please follow the guidelines in the future.

thanks @ruddell, very friedly... but I uninstall all before, I have no dudes of this procedure.
I just said: i make an empty project with 4.1.13, i am trying to deploy to heroku... and it is impossible... and i think this is a bug.
thanks

Please @lafalangito follow our guidelines - if you have an issue with Heroku it's something different, you did not tell us about this at all, and this ticket isn't about Heroku.
Please create a ticket, following the project's issue template and guidelines.

Sorry again @jdubois. As I said before, I think the error that is being discussed here has to do with the thread you closed yesterday. That is the reason for putting it here.
I thought that by updating the project to the correct version, as you advised me yesterday, the problem would be solved, but it has not been like that.
Tomorrow I will try to open a ticket correctly.
Please forgive the problems caused

No problem @lafalangito - opening a ticket is free and if you follow our guidelines it's very easy for us to reproduce. Usually we have a good track record on answering tickets, but we also need help for reproducing.

thanks @jdubois

Was this page helpful?
0 / 5 - 0 ratings