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

Abierto
#3 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript, typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
58
Forks
5
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de maxrave-dev/utils

Todos los issues de maxrave-dev/utils

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.