Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service worker registration failed. Status code: 2 #164

Open
abeisleem opened this issue Sep 2, 2024 · 6 comments
Open

Service worker registration failed. Status code: 2 #164

abeisleem opened this issue Sep 2, 2024 · 6 comments
Assignees

Comments

@abeisleem
Copy link

abeisleem commented Sep 2, 2024

I'm getting the following error when using the content-react template from running npx extension create my-extension --template=content-react

image

I'm using it as is -- have not made any changes yet.
This can be found by navigating to chrome://extensions and pressing the Reload icon on the extension.

That template comes with a background.ts file that has the below code that's not console logging:

console.log('Hello from the background script!')

The is not an issue when:

  • I run dev and then manually Load Unpacked onto Chrome
  • I build and start the extension.

System info:
extension v2.0.0-alpha.8
pnpm v9.7.0
Chrome Version 128.0.6613.120 (Official Build) (64-bit)

PS. None of the template commands in https://extension.js.org/n/getting-started/templates work. I had to figure out that the template are named after the folders in https://github.com/extension-js/extension.js/tree/main/examples

@abeisleem
Copy link
Author

cc: @cezaraugusto :)

@cezaraugusto
Copy link
Member

hey @abeisleem thanks for trying Extension.js!

Regarding the templates, I still need to update the website. So far the v2.0.0 is taking all my free time. If you're feeling adventurous, I'd love to see a PR in https://github.com/extension-js/extension.js.org updating the template list.

Regarding the CLI not running, I just released 2.0.0-alpha.20, below a video of me running the template, seems fine for this release. Let me know if not. Don't forget the "@latest" part, npx cache is very consistent.

npx extension@latest create my-extension --template=content-react
issue164.mp4

@abeisleem
Copy link
Author

Thanks @cezaraugusto!

I just gave this a try and created a new extension (at the time of running I got v2.0.0-alpha.22) and I'm getting the following error:
image

I tried again with v2.0.0-alpha.22 and it lead to the same error. The extension manager is not running at all.

I noticed you're running dev with yarn, while I'm using pnpm. I imagine that shouldn't make a difference but pointing it out.

@abeisleem
Copy link
Author

FYI, I opened a PR for the templates: https://github.com/extension-js/extension.js.org/pull/6

@cezaraugusto
Copy link
Member

@abeisleem thanks! what OS are you using and which command are you running?

@abeisleem
Copy link
Author

abeisleem commented Sep 6, 2024

My pleasure, @cezaraugusto! I'm using Windows 11 and the commands I'm running are npx extension create ... as shown above. And for development, I'm running pnpm dev which run extension dev that's in the package.json's scripts.

@cezaraugusto cezaraugusto self-assigned this Sep 6, 2024
@cezaraugusto cezaraugusto removed their assignment Sep 12, 2024
@cezaraugusto cezaraugusto self-assigned this Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants