Chrome Extension Load Error: The manifest_version key must be present and set to 2

manifest_version key must be present and set to 2

 

If you are working through an older chrome extension tutorial, you will probably run through this error before any other error.  The reason you will likely get this error is that Chrome did not always force a version_manifest value in the manifest.json file.  Since moving from manifest_version 1 to manifest_version 2, I believe Google started to force the manifest to be declared because there were some changes from manifest_version of 1 to manifest_version of 2 that could break applications.

Two fix this issue, you need to add manifest_version: 2 into the code, and make sure it still results in a validated json format.

Example of Manifest.json that will cause this error

{
"name": "A Sample Chrome Extension",
"version": "1.0",
"description": "Description of your Chrome extension.",
"browser_action": {
"default_icon": "icon.png",
"popup": "popup.html"
},

“icons”:{
“128”:”icon_128.png”
}
}

 

Example Of Manifest.json that will fix this error


{
"name": "A Sample Chrome Extension",
"version": "1.0",
"manifest_version": 2,
"description": "Description of your Chrome extension.",
"browser_action": {
"default_icon": "icon.png",
"popup": "popup.html"
},

“icons”:{
“128”:”icon_128.png”
}
}

[xyz-ihs snippet=”Fixing-the-Tutorialzine-Chrome-Extension-Tutorial-Series-of-Posts”]