Skip to content

404 /@npm/@npm/[package-name] - npm registry lookup failed #903

Open
@rejhgadellaa

Description

@rejhgadellaa

Describe the bug

When running wmr in dev/watch mode I often get the following error when I try to view the page in my browser:

404 /@npm/@npm/[package-name] - npm registry lookup failed for "@npm/[package-name]": Package doesn't exist.

The error is not very consistent, sometimes the page loads but at least ~50% of the time I see the error and I have to exit, delete the .cache folder and restart wmr and hope it works.

It's not very consistent with which package it can't find, either. Most of the time it's one package, sometimes multiple. So far, I think I've only seen the following packages not being found:

  • object-assign
  • react-is

The packages in question are present in the node_modules folder. I checked the .cache/@npm folder, and if the error occurs, the packages are missing there, so it seems wmr (silently) fails to cache the package?

This issue makes working with wmr pretty impossible for me :(

Note: Not entirely sure if deleting the .cache folder is required but from my observations so far, restarting wmr without deleting the .cache folder just causes the same error with the same package every time I reload the page. When I do delete the cache folder, it either works or I get another 404 but not always the same package.

To Reproduce

Steps to reproduce the behavior:

  1. Cd into a project, run npm start
  2. Open a browser and navigate to localhost:8080
  3. Observe wmr for 404 errors

Expected behavior

I expect no 404 errors

Bug occurs with:

  • wmr or wmr start (development)
  • wmr build (production)
  • wmr serve

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome
  • Node Version: 16.13.1
  • WMR Version: ^3.7.2

Additional context

#882 covers the same issue but has been closed by the reporter without a clear description of the cause and/or how to fix it. Another user reported he's (also) seeing this issue with the filter-obj package.

This problem occurs whether I run wmr via PowerShell or a Ubuntu terminal (WSL 1.x). Note: I do run the WSL terminal in the same (windows mounted) folder, so /mnt/c/path/to/project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompatCJS/UMD/etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions