Warning when running with Angular + Vite
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- angular, typescript, vite
- Lĩnh vực
- build-system, frontend
Hướng nghiên cứu
Bắt đầu với phần thiết lập Angular trong main.ts sử dụng defineCustomElements và tái hiện cảnh báo bằng ng serve trong một dự án Angular 17 mới. So sánh giải pháp khắc phục cấu hình Vite từ issue 109 với hành vi của package pwa-elements; được xem là hoàn tất khi package hoạt động offline mà không tạo ra cảnh báo import động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Running a fresh Angular 17 project, which uses Vite, and latest Capacitor.
Added pwa-elements as described in the Capacitor docs https://capacitorjs.com/docs/web/pwa-elements#angular:
main.ts:
import { defineCustomElements } from '@ionic/pwa-elements/loader';
defineCustomElements(window);
Running the code (ng serve) results in this warning: "The above dynamic import cannot be analyzed by Vite".
Notably, everything does still seem to function, but the warning is a nuisance.
Hard to say if the issue is more with the stencil version that builds pwa-elements or what.
Workarounds
Changing the vite config as described here https://github.com/ionic-team/pwa-elements/issues/109#issuecomment-1405061645 might potentially work, except Angular doesn't currently support configuring vite (https://angular.io/guide/esbuild#:~:text=currently%20cannot%20be%20directly%20configured).
Instead including pwa-elements via a cdn script tag in index.html does remove the warning, but doesn't work for offline scenarios.
- Ngôn ngữ chính
- TypeScript
- Star
- 172
- Fork
- 50
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ionic-team/pwa-elements
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
ionic-team/pwa-elements#135 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
ionic-team/pwa-elements#133 ·
-
Unable to use in esm package. Module not found: Can't resolve '@ionic/pwa-elements/loader/index.js'Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
ionic-team/pwa-elements#128 · 10 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
ionic-team/pwa-elements#113 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
ionic-team/pwa-elements#111 · 1 bình luận · 2 reaction ·
Tất cả issue của ionic-team/pwa-elements
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
StabilityNexus/Fate-EVM-Frontend#153 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
code-yeongyu/oh-my-openagent#9039 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Tencent/teamai-cli#862 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue hacktoberfest redis
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
libredb/libredb-studio#1164 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
flake
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
coder/xum#4920 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày