16

I've create an application with JHipster v4. When I make a request on port 8080 it is returning a blank page. If I use yarn start, and I make a request to 9000 port, it is answering correctly.

Any idea?

tk421
  • 5,775
  • 6
  • 23
  • 34
Víctor
  • 416
  • 5
  • 15

5 Answers5

12

I had the same issue with JHipster application bringing up the blank page on port 8080 when ran with ./mvnw in dev mode. I was able to resolve this by running:

yarn install && yarn webpack:build

After it finishes, the application shows normally in dev mode on port 8080.

Srki Rakic
  • 499
  • 5
  • 15
  • This fixed it for me. But it's weird. directly after the project was generated, everything was fine. Then I opened the project in eclipse and attempted to run there. From there things went sideways. ALTHOUGH, I *might* have run a `mvn clean` from eclipse... – demaniak Jan 02 '18 at 07:40
  • What would be other steps worth trying when this and all suggestions below don't work? – JasperJ Mar 12 '18 at 14:41
2

I had the same issue where on port 8080, it was returning nothing and on 9000 it gave correct page , after yarn install && yarn webpack:build I get correct page on both, I noticed that if I only run .mvnw, the application runs fine and I do not need to run "yarn start"

Raj
  • 747
  • 1
  • 9
  • 19
1

By default, yarn listens on port 9000 (webpack + browser sync) to hot reload frontend code and contents, maven or gradle listens on port 8080 to hot reload server code. You must run both in dev.

If you start making changes to the client side code without having yarn start running, nothing will be reflected as the changes are not compiled so you need to either run yarn webpack:build manually after changes or have yarn start running.

It's written in the README.md of the project you generated and is documented on JHipster web site.

Gaël Marziou
  • 16,028
  • 4
  • 38
  • 49
  • I'll try to explain me better. If I start a project with mvnw or mvnw -P dev (I think is the same) I get a blank page. I think I should get a answer with content independently if I'm using yarn or not. – Víctor Feb 06 '17 at 08:48
  • 2
    Only if you have bundled frontend code with yarn webpack:build before starting mvn. – Gaël Marziou Feb 06 '17 at 10:04
  • This is the correct answer. Please have a look at our documentation at https://www.jhipster.tech/development/ for more details – Julien Dubois Jul 22 '18 at 05:48
  • @Victor Since your profile does not have any accepted answer, please have a look at [What should I do when someone answers my question?](https://stackoverflow.com/help/someone-answers) – fantaghirocco Sep 28 '21 at 13:43
0

You should run npm install then mvnw, and it will run good.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Chebbi Ala Eddine
  • 175
  • 1
  • 2
  • 13
  • JHipster by default is not using npm, it use yarn, so we must use "yarn install". After that, you could do mvnw that is starting ther proyect on 8080 but returning a blank page. If I try "yarn start" it start on 9000 and everything is working on port 9000 but not on 8080. – Víctor Feb 13 '17 at 09:07
  • jhipster use yarn in the client side , i got the same issue i did npm install then ./mvnw and it worked – Chebbi Ala Eddine Feb 13 '17 at 09:09
0

For me (using npm for the front-end), just running npm start before mvnw makes the front-end available on 8080. On the other hand, running npm start after mvnw will bring a blank page on 8080.

Hugo P
  • 134
  • 1
  • 4