generator-jhipster: styling errors on Tomcat after upgrade to 5.4.2 when packaging for prod

updated it after bellow investigation:

Overview of the issue

After doing an upgrade from 5.3.1 to 5.4.2 all seemed to work fine when working from my developer machine, but after doing a package and deploy to tomcat the fonts are wrong and i noticed that the main.[hash].css is empty and in a different location. there were also strange chars comming from javascript files like nbsp; had an A in front and euro sign was strange.

firefox can not find the man.*.css file which is empty

Besides moving from 5.3.1 to 5.4.2 i also switched from yarn to npm.

i have found end of pipeline solutions to my problems but did not find root cause.

  1. the fonts were back when i added !important, this suggests the order is different than before i did the upgrade
  2. i needed to add charset=“UTF-8” to the script import tags in the index.html files. i do not know why this is needed now and not in the previous version. Adding this by hand is not good is there a way to add this automatically or make it not needed any more?
JHipster Version(s)

5.4.2

JHipster configuration

jhipster info 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)
stand-bystand@0.0.0 /home/tibi/git/standBystand
└── (empty)

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file

Environment and Tools

openjdk version “1.8.0_181” OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.18.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

git version 2.17.1

node: v8.11.3

npm: 6.2.0

yeoman: 2.0.5

yarn: 1.9.4

.yo-rc.json:

{ “generator-jhipster”: { “promptValues”: { “packageName”: “nl.tibi.sbys”, “nativeLanguage”: “en” }, “jhipsterVersion”: “5.4.2”, “baseName”: “standBystand”, “packageName”: “nl.tibi.sbys”, “packageFolder”: “nl/tibi/sbys”, “serverPort”: “8080”, “authenticationType”: “session”, “cacheProvider”: “ehcache”, “enableHibernateCache”: true, “websocket”: false, “databaseType”: “sql”, “devDatabaseType”: “mysql”, “prodDatabaseType”: “mysql”, “searchEngine”: false, “messageBroker”: false, “serviceDiscoveryType”: false, “buildTool”: “maven”, “enableSocialSignIn”: true, “enableSwaggerCodegen”: false, “rememberMeKey”: “xxxxxxxxxx”, “clientFramework”: “angularX”, “useSass”: false, “clientPackageManager”: “npm”, “applicationType”: “monolith”, “testFrameworks”: [], “jhiPrefix”: “jhi”, “enableTranslation”: true, “nativeLanguage”: “en”, “languages”: [ “en”, “nl”, “de” ] } }

Browsers and Operating System

ubuntu 18.04

  • 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: 82 (79 by maintainers)

Most upvoted comments

tibi@tibi:~/git/tmpJhipsterTest$ git checkout fix/jib-www fatal: not a git repository (or any of the parent directories): .git

you have two options revert to this: webpack.prod.js

    output: {
        path: utils.root('target/www'),
        filename: 'app/[name].[hash].bundle.js',
        chunkFilename: 'app/[id].[hash].chunk.js'
    },

or open the generated code and change in the index.html the js imports like this: add this: ** charset=“UTF-8” **

<script type="text/javascript" charset="UTF-8" src="app/main.22f54a2828dfd15ea9ee.bundle.js"></script> 

Thanks @tibistibi ! Let’s wait to have some feedback, in particular from @danielpetisme , and if that’s OK let’s switch back. This has been working for years, without a good reason I don’t think we should change this.

I just tested and I totally have this issue - in fact it’s even worse, it can’t load my front-end as there is a script error caused by a broken character.

I’m pinging @danielpetisme as he did that change, and I don’t understand why:

  • We’ve had code in the “target/www” folder for years and that was working fine
  • Putting it in “target/classes/public” causes the side effect: I’m not sure, but I’m guessing this causes Spring MVC to treat them differently (src/main/resources/public is a specific folder where files are exposed through Spring MVC)

-> anybody knows a good reason for this change? Otherwise let’s switch back to target/www

I would suggest using a tool like SmartSynchronize to compare your upgraded project with a new one. It’ll show you which files are different.

On Oct 17, 2018, at 05:43, Tibor Strausz notifications@github.com wrote:

@pascalgrimaud yes sorry about me puzzeling but it is because i do not know where to look for this and hope there is some information here in the community. I do not want to take more time than needed but working with jhipster makes me dependant on knowledge from this community. and i’m also trying to give time back in return.

@deepu105 maybe i’m unclear but when i talk about upgrades i’m referring to upgrades done with jhipster upgrade. i know you guy’s will mostly work with fresh projects and in there this project will not happen. but when people work with jhipster they will not start over again but upgrade it with jhipster upgrade and it could be that things go wrong there. like the package.json i would expect it would be the same after upgrading compared to new projects.

what i would like to know is where to look. there obviously is a difference between the new project and my upgraded project but which files should be interested in this case? i hope someone has an idea.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.