sinopia
sinopia copied to clipboard
Publishing package with missing fields in package.json causes crash
Publishing package with missing fields (e.g.: "description", "main") causes Sinopia to crash due to the use of these fields in the index page template.
TypeError: Cannot read property 'name' of undefined
at Object.<anonymous> (/opt/sinopia/node_modules/sinopia/lib/index-web.js:41:65)
At the same time public npm repository automatically add the missing fields with their default values to the package.json. Either making the template accept null values or filling the missing values with their default values will help avoiding unnecessary Sinopia crashes.
The above error was fixed with adding the following lines to the package.json:
+ "description": "foo",
+ "main": "js/core.js",
+ "author": "bar",