Service Worker registration failed (Status code: 15) and Popup malfunction due to uncompiled TypeScript

Đang mở
#3 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

The report names background.js, popup.ts and popup.html, where the popup loads popup.js that does not exist in the source. Start by checking whether the repo has any TypeScript build step or config, and whether popup.html points at a compiled file. The maintainer has not chosen between shipping compiled JS and adding a build script, so confirm that direction before editing. Done means the extension loads, the service worker registers and the popup works in Chrome.

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

Mô tả

Description I encountered an issue where the Service Worker failed to register with Status code: 15. Additionally, the popup was not functioning correctly.

Root Cause Upon investigation, I found that the source files (
background.js
and
popup.ts
referenced as
popup.js
) contain TypeScript syntax (interfaces, type annotations).

background.js
: Contains interface definitions and type annotations. Browsers cannot execute this directly, leading to a SyntaxError and Service Worker failure.
popup.html
: References
popup.js
, but only
popup.ts
exists in the source, which also contains TypeScript.
Fix I was able to resolve these issues by transpiling the TypeScript code into valid JavaScript (removing types and interfaces).

Environment

OS: Windows
Browser: Chrome
Suggestions It seems the project is intended to be built with TypeScript, but the distributed/source files are mixed. It would be helpful to either:

Distribute compiled
.js
files.
Or include a build script/instruction to generate the JS files from TS.

GoodDay!
日本から、愛をこめて

P.S:すでに対応済みだったらごめんなさい。何かあったら教えてください。怒らんといてください、16なんで愛嬌的な感じで許してください、何でもしますから!(何でもするとは言っていない)

SimpMusic様改善済み_utils-main.zip

Ngôn ngữ chính
TypeScript
Star
58
Fork
5
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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của maxrave-dev/utils

Tất cả issue của maxrave-dev/utils

Issue tương tự

Thêm issue về TypeScript

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.