question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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.

screen shot 2017-02-02 at 6 50 52 am

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:closed
  • Created 7 years ago
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
mraiblecommented, Feb 13, 2017

I think we can do better than improve the docs. With AngularJS, the entity generator runs gulp after it generates the entities, both for jhipster:entity[1] and jhipster: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?

  1. https://github.com/jhipster/generator-jhipster/blob/master/generators/entity/index.js#L641
  2. https://github.com/jhipster/generator-jhipster/blob/master/generators/import-jdl/index.js#L85
1reaction
deepu105commented, Feb 2, 2017

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

  • ./mvnw -Pdev, ​webpack
  • ./gradlew -P ​dev -P ​ webpack

Thanks & Regards, Deepu

On Thu, Feb 2, 2017 at 3:24 PM, Julien Dubois notifications@github.com wrote:

OK I got it working on my laptop without any issue, this is either a config error (my first comment) or the commands not running (my second comment)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/5062#issuecomment-276971078, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlFxm6hAOLwYvyUhhmyYGK-Hqexd8pks5rYecYgaJpZM4L1J_u .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bundle not updating after included file has changed (returns ...
The only way to update the bundle was to rebuild my solution - obviously not the best approach. However as soon as I...
Read more >
Bundling and Minification | Microsoft Learn
Bundling is a new feature in ASP.NET 4.5 that makes it easy to combine or bundle multiple files into a single file. You...
Read more >
How we do bundling and minification in ASP.NET Core
A pretty simple solution, but with a range of downsides: You need to compile the project to rebuild bundles (not a problem if...
Read more >
Problems with adding NOT NULL columns or making nullable ...
Phil Factor explains the problems you might encounter when adding a non-nullable column to an existing table or altering a column that ...
Read more >
vSAN Monitoring and Troubleshooting - VMware vSphere 6.7
Not Compliant Virtual Machine Objects Do Not Become Compliant Instantly 37 ... vSAN® by using the vSphere Client, esxcli and RVC commands, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found