chrome extension background page error: "Uncaught SyntaxError: Unexpected token <"

google-chrome-extension, html, javascript

Solution

I had the same issue. Just replace in your `manifest.json` file

"background": {
    "scripts": ["background.js"]
  },

with:

"background": {
    "page": "background.html"
  },

Problem

Why is my background.html page throwing this: `Uncaught SyntaxError: Unexpected token <` in line 1 Here is the actual html: ``` <html> <head> <script type="text/javascript" src="fancy-settings/source/lib/store.js"></script> <script type="text/javascript" src="background.js"></script> </head> <body></body> </html> ``` So chrome complains about the first opening "<" and I have no idea why.

Original source