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.

Ionic 4 - Styles being injected only after first livereload

See original GitHub issue

Bug Report

Ionic Info Run ionic info from a terminal/cmd prompt and paste the output below.

Ionic:

   ionic (Ionic CLI)          : 4.0.3 (/home/linuxbrew/.linuxbrew/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.0
   @angular-devkit/core       : 0.7.2
   @angular-devkit/schematics : 0.7.2
   @angular/cli               : 6.1.2
   @ionic/ng-toolkit          : 1.0.2
   @ionic/schematics-angular  : 1.0.2

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : none

System:

   Android SDK Tools : 26.0.2
   NodeJS            : v10.5.0 (/home/linuxbrew/.linuxbrew/lib/node_modules/node/bin/node)
   npm               : 6.1.0
   OS                : Linux 3.16

Environment:

   ANDROID_HOME : /home/matheushf/Android/Sdk

Describe the Bug When I first start my project with ionic serve --lab, it all starts normally, except that some styles are not injected, and the appearance is all broken, elements like ion-cards, ion-toolbar etc. But when you make any change to any file, the livereload brings the styles, and everything is back to normal.

The problem is making a build, you don’t have livereload there.

Steps to Reproduce Steps to reproduce the behavior:

  1. Start the project
  2. All broken
  3. Make a change
  4. All good

Related Code captura de tela de 2018-08-14 15-24-17 captura de tela de 2018-08-14 15-24-29

Expected Behavior All styles should appear on the first ionic serve, and ionic build

Additional Context I noticed that [data-ion-card-md-host] doesn’t gets styled on the first ionic serve, and that styles like <style data-style-tag="ion-card" data-style-mode="ion-card" data-style-scoped="true"> are only injected after the first livereload

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:27 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
matheushfcommented, Aug 30, 2018

It still wasn’t solved.

I’ve tried putting this page from the screenshot in the first page that loads (app.component.html) and it loads perfect with all styles, but it doesn’t load the styles when using it after two routing states (1 with href from ion-tabs and another from this.router.navigateByUrl.

2reactions
luishmcmorenocommented, Sep 7, 2018

I’m facing the same problem. @matheushf Did you fixed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic 4 - Styles being injected only after first livereload #15174
When I first start my project with ionic serve --lab, it all starts normally, except that some styles are not injected, and the...
Read more >
Live Reload | Ionic Documentation
When active, Live Reload will reload the browser or Web View when changes in the app are detected. This is particularly useful for...
Read more >
Change in CSS does not reload entire ionic/angular app. | by ...
I have been working on this ionic project and came across this interesting behaviour shown by the ionic live development server.
Read more >
Introduction to Ionic 4: How Web Components Changed the ...
Based on Web Components Ionic is a collection of UI components for building high-quality, cross-platform apps. These components are all ...
Read more >
Ionic Live Reload - Takes long time and doesn't save page
For style changes you can make adjustments in the browser dev window while inspecting elements with no reload time, then "finalise" them in...
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