just-jeb / angular-chrome-extension

81 stars 29 forks source link

Extension not working - Problem with manifest.json #3

Closed plackowski closed 4 years ago

plackowski commented 4 years ago

Hi, I cloned your repo, and when I try to load your extension I have "Failed to load extension" message.

Error: Could not load script running in the background "background.js".

Any idea?

My global Angular CLI: 9.0.1. Local CLI: 8.3.25.

just-jeb commented 4 years ago

Have you compiled it?

plackowski commented 4 years ago

If you ask for 'ng build' then yes (without any errors). Before of that I tried to create plugin step by step using your turorial on medium.com, but with the same results :(

plackowski commented 4 years ago

As can I see. I cannot loading the extension after adding background.ts (in my plugin made step by step with your tutorial). Maybe it is something with "@angular-builders/custom-webpack:browser". Besides of that, another plugin cloned with your ext also doesn't work for me as I mentioned before.

just-jeb commented 4 years ago

Ok, the problem appeared with the newer versions of Angular CLI since they changed the naming of output bundles with differential loading.
You don't need the differential loading feature in your Chrome extension anyways so just disable it by setting target to es5 in tsconfig.json.
I updated the repo and the article, should work now.