npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

NPM search serving up broken JSON for certain packages

What I Wanted to Do

I searched for underscore.date and attempted to click on its name in order to view its page on npmjs.com.

What Happened Instead

The search page displayed a red flash with the text “error loading page”. Viewing the console, it appears it failed to parse JSON when attempting to load a record from https://www.npmjs.com/package/underscore.date.

Reproduction Steps

  1. Visit https://www.npmjs.com/search?q=underscore.date
  2. Attempt to click on underscore.date. An “error loading page” flash will appear.

Details

Checking the network logs, I can see that the data it attempted to retrieve was JSON with this content: https://gist.github.com/mistydemeo/cbad5a59bb0796e3c5fbc62ff9f19b23

That data is invalid; the “readme” section’s data key consists of text that is not inside a string. Here’s the relevant part of the JSON:

"readme":{"data":The request failed while talking to the backend.,"ref":"readme"}

EDIT: I just noticed - if you navigate directly to the page, it displays, but the readme text is “The request failed while talking to the backend.”