Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versions panel failure occurs if there are any installed editable modules. #57

Open
enginaygen opened this issue Sep 19, 2024 · 0 comments

Comments

@enginaygen
Copy link

The versions page does not load, and the following error appears in the console. 'purepower' is an editable module in my environment, so the script can't find it on pypi.org and fails to load the page.

pypi.org/pypi/purepower/json:1
Failed to load resource: the server responded with a status of 404 ()

It can be fixed by changing the updateRow function in versions.js as follows:

  if (data === null || !(rowVersion.textContent in data.releases)) {
    fetch(`https://pypi.org/pypi/${name}/json`).then(function (response) {
      if (response.ok) {
        response.json().then(function (pypi) {
          const data = getData(pypi);

          if (!(rowVersion.textContent in data.releases)) {
            data.releases[rowVersion.textContent] = null;
          }
          localStorage.setItem(`pypi-${name}`, JSON.stringify(data));
          render(rowVersion, data);
          resolve();
        });
      }
      else {
        resolve();
      }
    });
  } else {
    render(rowVersion, data);
    resolve();
  }
});

}

@enginaygen enginaygen changed the title Versions panel failure if is there any installed editable modules Versions panel failure occurs if there are any installed editable modules. Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant