ionic-team / ionic-team/ionic-framework

bug: Application not work property on production mode

Đang mở
#30,426 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
triage
Ngôn ngữ chính
TypeScript
Star
52.7k
Fork
13.3k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
51

Mô tả

### Prerequisites

- [x] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [x] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [x] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

v8.x

### Current Behavior

If code is running in dev live mode `ionic capacitor run android -l --external` work correctly - modal is showing
But in production mode `ionic capacitor run android` / `ionic capacitor build android --prod` modal is not showing
In console is only
![Image](https://github.com/user-attachments/assets/5423c58d-c791-4d97-8a09-8c63ef294184)

Example code

```
import { Component, OnInit } from '@angular/core';
import { IonicModule } from '@ionic/angular';

@Component({
standalone: true,
selector: 'app-test',
template: '

Hello Modal!

',
imports: [IonicModule]
})
export class TestPage implements OnInit {
constructor() {
console.log('TestPage constructor called');
}

ngOnInit() {
console.log('TestPage ngOnInit called');
}
}
---
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
imports: [IonHeader, IonToolbar, IonTitle, IonContent, IonButton, IonicModule,TestPage],
})
export class HomePage {
constructor(
private modalCtrl: ModalController,

) { }
async test() {
console.log(this.modalCtrl);
console.log('start');
try {
const modal = await this.modalCtrl.create({
component: TestPage,


});
console.log('Modal object after creation (if await works):', modal);
await modal.present();
console.log('Modal presented!');
} catch (error) {
console.error('Error creating or presenting modal:', error);
}
}
}
----
test

```

### Expected Behavior

Code should work on this samo way in production mode and live mode

### Steps to Reproduce

1. cerate new blank angular type application
2. add capacitor android
3. add new page
4. Create and present ModalController with component from step 3
5. run android capacitor in "not live mode"

### Code Reproduction URL

https://github.com/mzawodzinski/ionicIssue

### Ionic Info

[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module
'@capacitor/ios/package.json'

Require stack:
- /usr/local/lib/node_modules/@ionic/cli/lib/project/index.js
- /usr/local/lib/node_modules/@ionic/cli/lib/index.js
- /usr/local/lib/node_modules/@ionic/cli/index.js
- /usr/local/lib/node_modules/@ionic/cli/bin/ionic

Ionic:

Ionic CLI : 7.2.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 8.5.7
@angular-devkit/build-angular : 19.2.13
@angular-devkit/schematics : 19.2.13
@angular/cli : 19.2.13
@ionic/angular-toolkit : 12.2.0

Capacitor:

Capacitor CLI : 7.2.0
@capacitor/android : 7.2.0
@capacitor/core : 7.2.0
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.19.0 (/usr/bin/node)
npm : 11.4.1
OS : Linux 6.9

### Additional Information

_No response_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with the linked reproduction project and run the reported live and production commands: `ionic capacitor run android -l --external` and `ionic capacitor run android` or `ionic capacitor build android --prod`. Compare the console output and modal behavior; the work is done when the component modal appears in production as it does in live mode.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, angular, typescript
Lĩnh vực
frontend, mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.