Ionic angular application does not show style when is built

Discussão em 'Angular' iniciado por Lucke, Maio 14, 2025.

  1. Lucke

    Lucke Guest

    I have a very basic Ionic application, I haven't added anything too complicated yet.

    When I run: "ng serve" everything works fine.

    However when I execute

    ionic build --prod -- --base-href /www/


    and after that to try the application I open a server on that folder "www" the application works but some components from Ionic just does not appear.

    I haven't changed anything or almost anything that is because I find weird that is not working My dependencies:

    "dependencies": {
    "@angular/animations": "^17.0.2",
    "@angular/common": "^17.0.2",
    "@angular/compiler": "^17.0.2",
    "@angular/core": "^17.0.2",
    "@angular/forms": "^17.0.2",
    "@angular/platform-browser": "^17.0.2",
    "@angular/platform-browser-dynamic": "^17.0.2",
    "@angular/router": "^17.0.2",
    "@capacitor/android": "6.0.0",
    "@capacitor/app": "6.0.0",
    "@capacitor/core": "6.0.0",
    "@capacitor/haptics": "6.0.0",
    "@capacitor/keyboard": "6.0.0",
    "@capacitor/status-bar": "6.0.0",
    "@ionic/angular": "^8.0.0",
    "ionicons": "^7.2.1",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.2"
    },


    Page that is not working as should.

    import { Component, OnInit } from '@angular/core';
    import { User } from 'src/app/shared/user/User.model';
    import { UserService } from 'src/app/shared/user/User.service';
    import { IonicModule } from '@ionic/angular';
    import { CommonModule } from '@angular/common';
    import { UserEngine } from 'src/app/shared/user/UserEngine';
    import { TapExamplerComponent } from 'src/app/components/tapexampler/tapExampler.component';
    import { playAudio } from 'src/app/utils/audioUtil';
    import { UserConfig } from 'src/app/shared/userconfig/UserConfig.model';
    @Component({
    selector: 'app-userMain',
    templateUrl: './UserMain.page.html',
    styleUrls: ['./UserMain.page.scss'],
    standalone: true,
    imports: [ IonicModule, CommonModule, TapExamplerComponent],

    })
    export class UserMainPage implements OnInit {
    ....
    }

    Continue reading...

Compartilhe esta Página