Client bundle not rebuilt after entity generation
See original GitHub issue- Please follow the issue template below for bug reports and feature requests.
- Tickets opened without any of these informations will be closed without any explanation.
Overview of the issue
I tried to create my blog demo from using JHipster 4.0.0 and found that no site is rendered on http://localhost:8080 after generating entities. yarn start
still works and I can see my app on http://localhost:9000.
Motivation for or Use Case
This worked when using npm link
from master a few weeks ago.
Reproduce the error
Create a new application with the following settings.

Here’s my .yo-json.rc
:
{
"generator-jhipster": {
"jhipsterVersion": "4.0.0",
"baseName": "blog",
"packageName": "org.jhipster",
"packageFolder": "org/jhipster",
"serverPort": "8080",
"authenticationType": "jwt",
"hibernateCache": "ehcache",
"clusteredHttpSession": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"buildTool": "maven",
"enableSocialSignIn": false,
"jwtSecretKey": "3725191ac098f3a1425059b2808301ab7c546e39",
"useSass": true,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"clientFramework": "angular2",
"testFrameworks": [
"gatling",
"protractor"
],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en",
"es"
]
}
}
Create an jhipster-jdl.jh
with the following contents.
entity Blog {
name String required minlength(3),
handle String required minlength(2)
}
entity Entry {
title String required,
content TextBlob required,
date ZonedDateTime required
}
entity Tag {
name String required minlength(2)
}
relationship ManyToOne {
Blog{user(login)} to User,
Entry{blog(name)} to Blog
}
relationship ManyToMany {
Entry{tag(name)} to Tag{entry}
}
paginate Entry, Tag with infinite-scroll
Generate entities using yo jhipster:import-jdl jhipster-jdl.jh
.
I had Maven running when I did this and noticed the menu was all wonky and didn’t have messages translated. I restarted and localhost:8080 results in a blank page. I ran mvn clean
and restarted again, but it’s still blank with no errors in my console. Running yarn start
works, but there’s still no app on localhost:8080.
Related issues
I noticed the navbar.component.html
still has old UI-Router attributes.
<ul class="dropdown-menu" ngbDropdownMenu>
<li uiSrefActive="active">
<a class="dropdown-item" routerLink="blog" (click)="collapseNavbar()">
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i>
<span jhiTranslate="global.menu.entities.blog">Blog</span>
</a>
</li>
<li uiSrefActive="active">
<a class="dropdown-item" routerLink="entry" (click)="collapseNavbar()">
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i>
<span jhiTranslate="global.menu.entities.entry">Entry</span>
</a>
</li>
<li uiSrefActive="active">
<a class="dropdown-item" routerLink="tag" (click)="collapseNavbar()">
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i>
<span jhiTranslate="global.menu.entities.tag">Tag</span>
</a>
</li>
<!-- jhipster-needle-add-entity-to-menu - JHipster will add entities to the menu here -->
</ul>
Suggest a Fix
JHipster Version(s)
4.0.0
JHipster configuration
Welcome to the JHipster Information Sub-Generator
##### **JHipster Version(s)**
blog@0.0.0 /Users/mraible/dev/blog ├── UNMET PEER DEPENDENCY @angular/compiler@2.4.4 ├── UNMET PEER DEPENDENCY @angular/core@2.4.4 └── generator-jhipster@4.0.0
##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
```yaml
{
"generator-jhipster": {
"jhipsterVersion": "4.0.0",
"baseName": "blog",
"packageName": "org.jhipster",
"packageFolder": "org/jhipster",
"serverPort": "8080",
"authenticationType": "jwt",
"hibernateCache": "ehcache",
"clusteredHttpSession": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"buildTool": "maven",
"enableSocialSignIn": false,
"jwtSecretKey": "3725191ac098f3a1425059b2808301ab7c546e39",
"useSass": true,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"clientFramework": "angular2",
"testFrameworks": [
"gatling",
"protractor"
],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en",
"es"
]
}
}
Entity configuration(s) entityName.json
files generated in the .jhipster
directory
Blog.json
{
"fluentMethods": true,
"relationships": [
{
"relationshipType": "many-to-one",
"relationshipName": "user",
"otherEntityName": "user",
"otherEntityField": "login"
}
],
"fields": [
{
"fieldName": "name",
"fieldType": "String",
"fieldValidateRules": [
"required",
"minlength"
],
"fieldValidateRulesMinlength": 3
},
{
"fieldName": "handle",
"fieldType": "String",
"fieldValidateRules": [
"required",
"minlength"
],
"fieldValidateRulesMinlength": 2
}
],
"changelogDate": "20170202135634",
"entityTableName": "blog",
"dto": "no",
"pagination": "no",
"service": "no"
}
Entry.json
{
"fluentMethods": true,
"relationships": [
{
"relationshipType": "many-to-one",
"relationshipName": "blog",
"otherEntityName": "blog",
"otherEntityField": "name"
},
{
"relationshipType": "many-to-many",
"otherEntityRelationshipName": "entry",
"relationshipName": "tag",
"otherEntityName": "tag",
"otherEntityField": "name",
"ownerSide": true
}
],
"fields": [
{
"fieldName": "title",
"fieldType": "String",
"fieldValidateRules": [
"required"
]
},
{
"fieldName": "content",
"fieldType": "byte[]",
"fieldTypeBlobContent": "text",
"fieldValidateRules": [
"required"
]
},
{
"fieldName": "date",
"fieldType": "ZonedDateTime",
"fieldValidateRules": [
"required"
]
}
],
"changelogDate": "20170202135635",
"entityTableName": "entry",
"dto": "no",
"pagination": "infinite-scroll",
"service": "no"
}
Tag.json
{
"fluentMethods": true,
"relationships": [
{
"relationshipType": "many-to-many",
"relationshipName": "entry",
"otherEntityName": "entry",
"ownerSide": false,
"otherEntityRelationshipName": "tag"
}
],
"fields": [
{
"fieldName": "name",
"fieldType": "String",
"fieldValidateRules": [
"required",
"minlength"
],
"fieldValidateRulesMinlength": 2
}
],
"changelogDate": "20170202135636",
"entityTableName": "tag",
"dto": "no",
"pagination": "infinite-scroll",
"service": "no"
}
Browsers and Operating System
java version “1.8.0_112” Java™ SE Runtime Environment (build 1.8.0_112-b16) Java HotSpot™ 64-Bit Server VM (build 25.112-b16, mixed mode)
git version 2.10.2
node: v6.9.1
npm: 3.10.8
bower: 1.8.0
gulp: [07:11:37] CLI version 1.2.2
yeoman: 1.8.5
yarn: 0.18.1
Docker version 1.13.0, build 49bf474
docker-compose version 1.10.0, build 4bd6f1a
Issue Analytics
- State:
- Created 7 years ago
- Comments:22 (22 by maintainers)
I think we can do better than improve the docs. With AngularJS, the entity generator runs
gulp
after it generates the entities, both forjhipster:entity
[1] andjhipster:import-jdl
[2].We’ve seen a LOT of issues related to this since we released 4.x. Why can’t the entity/import-jdl generators just run
webpack:build
after generation like we do with AngularJS?If you do a clean then you need to pass the the webpack profile switch in order to rebuild everything (I need to update this in docs) for maven/gradle run
Thanks & Regards, Deepu
On Thu, Feb 2, 2017 at 3:24 PM, Julien Dubois notifications@github.com wrote: