Tools: Invalid package.json in dependency cause bundle error

Created on 3 Mar 2020  ·  4Comments  ·  Source: rome/tools

Description:

In my case, the fill-range module has invalid package.json

✖ Expected a string at contributors[4]name
53 │       "url": "www.rouvenwessling.de"
54 │     },
55 │     {
56 │       "url": "https://github.com/wtgtybhertgeghgtwtg"
57 │     }
   │ ^^^^^ 
58 │   ],
59 │   "dependencies": {

Steps To Reproduce

Add fill-range as dependency and run rome bundle

Expected Results

rome should fail tolerant in parsing package.json of dependencies.

confirmed

All 4 comments

It’s not actually invalid; name isn’t a required field there.

@ljharb Yes it is.

The “author” is one person. “contributors” is an array of people. A “person” is an object with a “name” field and optionally “url” and “email”, like this:

https://docs.npmjs.com/files/package.json#people-fields-author-contributors

Thanks for the report! Fixed in #125. When we normalize manifests, there's a bunch of conditions we allow when inside node_modules that don't respect any of the npm package.json documentation. Otherwise we're strict.

Fair enough :-)

Was this page helpful?
0 / 5 - 0 ratings