Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome's webstore server reject an extension with "Error : The manifest must define a version."

NOTE: this question is about the version attribute of the manifest.json that you use when you do Chrome developpment. It looks similar with the question below about manifest_version but it's not. I really tried to learn from that but I failed.

Need to update Chrome extension to manifest version 2 if no manifest version originally specified?

--

I am currently doing my first Chrome extension. Powerful, fun, great.

Except a stupid thing that keeps annoying me.

My Chrome extension is open-source, so you can go straight to the code on GitHub so you can see in an instant that I made a stupid mistake

https://github.com/internaciulo/search-tab-in-chrome-s-omnibox

In manifest.json, the most imortant file in Chrome development, you should see

{
  ...
  "version": "13",
  ...
}

The chrome extension itself works well enough, see the screenshots folder on github, ... but only locally, that is when I open it as an unpackage app (this can be done in Chrome by going into chrome://extensions

Great, so I head up to [Chrome's Webstore Developer Dashbord], upload, let 2 or 3 users download it for free, Profit !


Not quite.

I tried everything : maybe he wants 13or "13" or "13.0" or there is a confusion with manifest_version which must be an integer or or or or. Every time the same annoying error :

Upload an extension or app (.zip file)
search-tab-in-chrome-s-omnibox.zip (Server rejected)
An error occurred: Failed to process your item.

The manifest must define a version.

Oh Computers, you are so useful, but why are so intolerants to our mistakes dear computer ? Yes, they are stupid, but since the beginning of Computing, you should have learned that we are "Humans, All Too Humans" (http://en.wikipedia.org/wiki/Human,_All_Too_Human)

PS: it's not only my first chrome extension, it's also my first question on stackoverflow, while I used it a lost in the past, but only read-only. Please be nice :-D

Updates:

  • 2013-10-13 : ok, problem solved, this was it : no comments in json files
  • 2013-10-13 : A part (only) of the bug is resolved thanks to @ChrisP: comments are not allowed in json files, which is sad but legitimate. https://github.com/getify/JSON.minify allows you to take json file with comments and output it minified without comments. Best of both worlds.
like image 836
jmfayard Avatar asked Oct 13 '13 06:10

jmfayard


People also ask

What is the manifest version of Chrome?

The manifest file. It's a JSON file that describes the behavior of a Chrome extension. You list things like: your extensions name; a description; which files or libraries you're including; and permissions your extension needs.

What is a manifest file Chrome extension?

The manifest file uses JSON format to describe the important information about the extension. It contains fields that are required and recommended while others are optional depending on the extension you are building. name refers to the name of the extension and should be up to 45 characters.

What is Chrome Manifest JSON?

Using manifest. json , you specify basic metadata about your extension such as the name and version, and can also specify aspects of your extension's functionality (such as background scripts, content scripts, and browser actions).


1 Answers

Your manifest.json file contains comments:

{
  "name": "__MSG_name__", // {en}: "Search Tab in Chrome's Omnibox" 
  "description": "__MSG_description__",
  ...
}

which are not allowed in JSON, cf http://json.org/.

If you remove them, your manifest should be valid, and the error should disappear. You can find JSON parsers online to ensure it's valid, for example:

  • http://www.jsoneditoronline.org/
  • http://json.parser.online.fr/
like image 67
Métoule Avatar answered Sep 17 '22 23:09

Métoule