kyrelldixon / svelte-tailwind-extension-boilerplate

A Chrome extension boilerplate built with Svelte, TailwindCSS, Jest, and Rollup.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

manifest v3

opened this issue · comments

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

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...

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