Skip to content

Ionic 4 - Styles being injected only after first livereload #15174

@matheushf

Description

@matheushf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions