Production build fails with AngularFire 7 & Firebase 9 (ES5 bundle problem)
- Ngôn ngữ chính
- TypeScript
- Star
- 7.8k
- Fork
- 2.2k
- Merge trung bình
- 22 giờ 28 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
### Version info
**Angular: 12.2.13**
**Firebase: 9.1.3**
**AngularFire: 7.2.0**
**Other (e.g. Ionic/Cordova, Node, browser, operating system): Ionic 5.8.5, Cordova 9, BraveBrowser, MacOS**
### How to reproduce these conditions
**Steps to set up and reproduce**
The problem occured when I ran `ionic build --prod`
Important! The problem appears only with Firebase 9 and AngularFire 7! With Firebase 8 and AngularFire 6 the production build works without any problem.
**Sample data and security rules**
### Debug output
```
› ionic build --prod
> ng run app:build:production
✔ Browser application bundle generation complete.
⠙ Generating ES5 bundles for differential loading...An unhandled exception occurred: {project-path}/main-es2015.059a60e139f9c6cfd626.js: Unexpected token (2461:8)
2459 | * limitations under the License.
2460 | */
> 2461 | function(de){return Promise.all(de.map(function(){var P=(0,f.Z)(function*(W){try{return{fulfilled:!0,value:yield W}}catch(Ie){return{fulfilled:!1,reason:Ie}}});return function(W){return P.apply(this,arguments)}}()))}(Io);dt.ports[0].postMessage({status:"done",eventId:Lt,eventType:Un,response:Yo})})()}_subscribe(W,Ie){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[W]||(this.handlersMap[W]=new Set),this.handlersMap[W].add(Ie)}_unsubscribe(W,Ie){this.handlersMap[W]&&Ie&&this.handlersMap[W].delete(Ie),(!Ie||0===this.handlersMap[W].size)&&delete this.handlersMap[W],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}
| ^
2462 | /**
2463 | * @license
2464 | * Copyright 2020 Google LLC
See "/private/var/folders/hx/vt3ky4d13xvb7856_4mwlj300000gn/T/ng-FP9bZ2/angular-errors.log" for further details.
[ERROR] An error occurred while running subprocess ng.
ng run app:build:production exited with exit code 127.
Re-running this command with the --verbose flag may provide more information.
```
The exact problem is the `function(de)`. It should be `function de()`, I think..
### Expected behavior
Successful build.
### Actual behavior
Build failure
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi với `ionic build --prod`, lệnh này gọi `ng run app:build:production`. Kiểm tra tệp `main-es2015.059a60e139f9c6cfd626.js` được tạo ra và bước differential-loading của Angular xung quanh lỗi parse đã được báo cáo; công việc được xem là hoàn tất khi production build hoàn thành thành công với Firebase 9 và AngularFire 7.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, firebase, typescript
- Lĩnh vực
- build-system
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 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
- 35/100