Preact: npm README field is blank

Created on 5 Jun 2019  路  7Comments  路  Source: preactjs/preact

To reproduce:

  1. curl https://registry.npmjs.org/preact | pbcopy (link)
  2. Open you favorite JSON formatter (ex: https://codebeautify.org/jsonviewer)
  3. See that the top-level "readme" property is empty string
  4. See that there is no "readme" property on the latest version (or any versions <10)
  5. See that a "readme" property does exist on the "next" version (and all versions 10+)

This is the only package I've seen this for in all of my npm traveling. I can't tell why this is (README does exist in the installed package) but just wanted to bring it to your attention since package README-viewers may be failing for your package.

Most helpful comment

I contacted npm support with that insight, hopefully I can find the root cause now!

All 7 comments

npm does seem to return it in the package: https://unpkg.com/[email protected]/

README.md is always included when npm creates tarballs:

Screen Shot 2019-06-06 at 11 06 16 AM

This seems like something more sinister - the registry includes a readme for both 8.4.2 and 10.0.0-beta.2.

I recall there was a mixup with dist-tags when publishing recently. Maybe 8.4.2 or 10.0.0-beta.2 was re-tagged and that doesn't update the top-level readme field?

I've seen this bug happening on random packages as well and can't find a pattern for it. I know that the npm website actually unpacks the tarball of the package backend to find the readme, which is why it's different to something you could make with the API. In Yarn's indexing process I added a GitHub fallback to find the readme's file name for this reason. I don't think preact can do anything about this

Looks like this issue has been fixed. The readme field properly displays the content of our README.

The root readme yes, but interestingly the individual versions only have a readme for alpha versions

Oh ok, just checked and our package contains the right version of the readme. Not sure why the registry points to something else. Like Jason said, it seems to be an issue with the registry when multiple tags are used. I don't think there is anything we can do to resolve that in Preact.

I contacted npm support with that insight, hopefully I can find the root cause now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasongerbes picture jasongerbes  路  3Comments

paulkatich picture paulkatich  路  3Comments

simonjoom picture simonjoom  路  3Comments

SabirAmeen picture SabirAmeen  路  3Comments

mizchi picture mizchi  路  3Comments