ParcelJs - building web extension manifest v3 doesn't resolve service_worker path

52 views Asked by At

I'm building a cross-browser extension. I see that Firefox doesn't support yet service workers, while they are mandatory for Chrome. So, I was making some tests in Chrome but when I try to build the extension manifest Parcel is not able to resolve the service worker path:

enter image description here

considering that:

  1. the same path works fine when used in as background "script" with the same manifest version (3)
  2. all other paths (for options page, popup, etc.) have the same structure and are recognized

The error I receive is the following:

enter image description here

it seems it is starting path resolution one directory above and missing the root of the project. I couldn't find anything online.

Any idea about this? Thanks.

I tried to put the absolute path, without success. I tried to put different kind of paths, without success.

It should be able to build and bundle the manifest correctly.

1

There are 1 answers

0
Fabrizio On

It seems the "rootDir" parameter in tsconfig was causing this issue. I really don't understand how it was working before. Really strange.

I just removed the "rootDir" from tsconfig.json and everything works fine now.