Reputation: 243
I am trying to follow the tutorial here - https://developer.chrome.com/extensions/getstarted
But I keep getting the following error when I'm trying to build my extension:
TypeError: Cannot read property 'sync' of undefined
Here is my manifest file:
{
"name": "Getting Started Example",
"version": "1.0",
"description": "Build an Extension!",
"permissions": ["storage"],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"manifest_version": 2
}
I have "permissions": ["storage"] included
Upvotes: 1
Views: 5227
Reputation: 51
I ran into this today. It seems if you get an error, it's not cleared even if you reload the extension - you have to explicitly clear the error seperately.
In chrome://extensions/ clicking on the extension in questions "Errors" button and then the "Clear all" button fixed the problem for me.
Upvotes: 5
Reputation: 31
If the error does not disappear after you have declared "storage" in the manifest, and also reloaded the extension. In this case, uninstall the extension and install it again. The error will disappear. Browsers are also buggy.
Upvotes: 3
Reputation: 329
Make sure to Reload your extension in the extension Manager. Check the picture bellow:
Upvotes: 0
Reputation: 56
If you're attempting to access the chrome.storage API from the console, you must select the chrome extension (like shown below). Hope it's any help.
Upvotes: 2