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

manifest v3 #4

Open
ghost opened this issue Sep 5, 2021 · 2 comments
Open

manifest v3 #4

ghost opened this issue Sep 5, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 5, 2021

Hi, I'm trying to upgrade to manifest v3 but I am not able to resolve the following error.

rollup v2.36.2
bundles src/manifest.json → dist...
[!] Error: There were problems with the extension manifest.
- ["background/index.ts"] at "/background/service_worker" must be string
...
...
...

Steps to replicate

  1. Update rollup-plugin-chrome-extension with yarn add rollup-plugin-chrome-extension@latest -D
  2. Specify "manifest_version": 3,` in the manifest.json file
  3. Change "browser_action" to "action" as per this migration guide.
  4. Run yarn dev
@ghost
Copy link
Author

ghost commented Sep 5, 2021

Quick update, I managed to stop the error from showing by moving replacing background/index.ts with background.ts but not sure if this is the right thing to do...

@shankscoder
Copy link

shankscoder commented Jun 3, 2022

Just chiming in here.

Quick update, I managed to stop the error from showing by moving replacing background/index.ts with background.ts but not sure if this is the right thing to do...

You need to rename the background/index.ts to background/ts as you need to change the reference from an array to a string.

Also, the new V3 standard expects the background.js file to exist in the project root.

Found this and more hints here: https://stackoverflow.com/questions/66114920/service-worker-registration-failed-chrome-extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant