Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showcase: wrong URL in manually referenced CSS on <head> in index.html due to missing deployURL #1037

Closed
christophercr opened this issue Jan 14, 2019 · 4 comments · Fixed by #1042

Comments

@christophercr
Copy link
Collaborator

christophercr commented Jan 14, 2019

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/NationalBankBelgium/stark/blob/master/CONTRIBUTING.md#got-a-question-or-problem

Current behavior

The latest version of the Showcase deployed in ghPages (version 10.0.0-beta.2) is not working properly due to the following errors:

GET 404 https://stark.nbb.be/assets/stark-core/css/pre-load-style.css

This CSS cannot be loaded due to a missing part on the URL related to the deploy URL: showcase/10.0.0-beta.2

The problem relies on the fact that the URL of this CSS is set like this:

<link rel="stylesheet" href="/assets/stark-core/css/pre-load-style.css" />

which does not take into account the deployURL that is generated dynamically by Angular CLI and it is overwritten by our build script when deploying to ghPages.

Expected behavior

The Showcase app should be fully working in all possible deployUrl's: latest and specific version.

Minimal reproduction of the problem with instructions

  1. Open the Showcase app in https://stark.nbb.be/showcase/10.0.0-beta.2/.
  2. After the application has initialized, open the browser console. The console displays the following errors:
GET 404 https://stark.nbb.be/assets/stark-core/css/pre-load-style.css

Environment


Angular version: 7.1.1
Stark version: 10.0.0-beta.2

@christophercr
Copy link
Collaborator Author

christophercr commented Jan 14, 2019

After fixing manually the URL of the pre-load-style.css in the Showcase v10.0.0-beta.2 and Showcase latest on ghPages, now the following errors appear:

GET https://stark.nbb.be/assets/stark-core/logo/stark_header_bg.png 404 ()
GET https://stark.nbb.be/assets/stark-core/logo/stark_logo_transparent.svg 404 ()

This seems to be related to the fact that the pre-load-style.css is manually referenced in the index.html so it is not processed by the Angular CLI when deploying the Showcase to ghPages.

@christophercr
Copy link
Collaborator Author

The same issue happens with the icons added to the <head><meta> tag although there is no error logged to the console:

<meta name="msapplication-TileImage" content="assets/images/app-icons/ms-icon-144x144.png">

Strange enough, the assets referenced in the <head><link> tags do have the right URL containing the deployURL.

Both tags in the <head> are automatically added by this plugin: html-elements-webpack-plugin

@carlo-nomes carlo-nomes self-assigned this Jan 14, 2019
carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 15, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 15, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 15, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 15, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 17, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 22, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
@christophercr
Copy link
Collaborator Author

For the moment this issue is blocked by #1070

@christophercr
Copy link
Collaborator Author

#1070 has been solved 👍

carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 28, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 28, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 28, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
carlo-nomes added a commit to carlo-nomes/stark that referenced this issue Jan 28, 2019
add stylesheet link through webpack instead of directly into `index.html`

ISSUES CLOSED: NationalBankBelgium#1037
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants