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

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

Open
1 of 3 tasks
rejhgadellaa opened this issue Jan 22, 2022 · 2 comments
Open
1 of 3 tasks

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

rejhgadellaa opened this issue Jan 22, 2022 · 2 comments
Labels
bug Something isn't working compat CJS/UMD/etc

Comments

@rejhgadellaa
Copy link

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.

@rejhgadellaa
Copy link
Author

rejhgadellaa commented Jan 22, 2022

For completeness, here's a full output when I run npm start and try to load it in the browser:

(In this case both react-is and object-assign can't be located)

> [email protected] start
> rimraf .cache && wmr

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating

  👩‍🚀 WMR dev server running at:

  Local:   http://localhost:8080
  Network: (disabled, see --host)


404 /@npm/@npm/react-is - npm registry lookup failed for "@npm/react-is": Package doesn't exist.

  at TT (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1194284)
  at  (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1239595)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async KR (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1239205)
  at async HR (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1239084)
  at async Array.<anonymous> (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:2934077)

404 /@npm/@npm/object-assign - npm registry lookup failed for "@npm/object-assign": Package doesn't exist.

  at TT (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1194284)
  at  (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1239595)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async KR (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1239205)
  at async HR (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1239084)
  at async Array.<anonymous> (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:2934077)

Another run with DEBUG=true.

This time object-assign is found, but react-is isn't.

I noticed the the line middleware:npm "object-assign" near the bottom - so that would mean it handles object-assign which is great :) But I don't see any entries mentioning the missing react-is package...?

DEBUG=true npm start

> [email protected] start
> rimraf .cache && wmr

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
  wmr:config  {
  wmr:config    _: [],
  wmr:config    compress: true,
  wmr:config    optimize: true,
  wmr:config    cwd: '/mnt/c/path/to/project',
  wmr:config    root: '/mnt/c/path/to/project/public',
  wmr:config    plugins: [],
  wmr:config    output: [],
  wmr:config    middleware: [],
  wmr:config    features: { preact: true },
  wmr:config    alias: { react: 'preact/compat', 'react-dom': 'preact/compat' },
  wmr:config    customRoutes: [],
  wmr:config    prod: false,
  wmr:config    mode: 'start',
  wmr:config    env: {},
  wmr:config    out: '/mnt/c/path/to/project/.cache',
  wmr:config    overlayDir: '/mnt/c/path/to/project/.cache',
  wmr:config    public: 'public',
  wmr:config    publicPath: '/',
  wmr:config    host: 'localhost',
  wmr:config    port: 8080
  wmr:config  }
  wmr:watcher  watching:
  wmr:watcher  - /mnt/c/path/to/project/public
  wmr:watcher  - /mnt/c/path/to/project/package.json

  👩‍🚀 WMR dev server running at:

  Local:   http://localhost:8080
  Network: (disabled, see --host)

  wmr:watcher   watching for config changes
  wmr:middleware  / -> ./ file: /mnt/c/path/to/project/public
  wmr:middleware  /index.js -> ./index.js file: /mnt/c/path/to/project/public/index.js
  wmr:resolve  ./index.js -> /mnt/c/path/to/project/public/index.js [resolve-extensions-plugin]
  wmr:load  /mnt/c/path/to/project/public/index.js [__fallback__]
  wmr:transform  ./index.js [preact-prefresh]
  wmr:transform  ./index.js [import-assertion]
  wmr:transform  ./index.js [process-global]
  wmr:transform  ./index.js [htm-plugin]
  wmr:transform  ./index.js [wmr]
  wmr:transform  ./index.js [default-loaders]
  wmr:transform.js  ./style.less -> ./style.less?module
  wmr:resolve  ./pages/_404.js -> /mnt/c/path/to/project/public/pages/_404.js [resolve-extensions-plugin]
  wmr:load  preact/debug [__fallback__]
  wmr:transform.js  preact/debug -> /@npm/preact/debug
  wmr:load  htm/preact [__fallback__]
  wmr:transform.js  htm/preact -> /@npm/htm/preact
  wmr:load  rgui-preact-core/core [__fallback__]
  wmr:transform.js  rgui-preact-core/core -> /@npm/rgui-preact-core/core
  wmr:load  preact-iso [__fallback__]
  wmr:transform.js  preact-iso -> /@npm/preact-iso
  wmr:load  rgui-preact-core [__fallback__]
  wmr:transform.js  rgui-preact-core -> /@npm/rgui-preact-core
  wmr:load  preact [__fallback__]
  wmr:transform.js  preact -> /@npm/preact
  wmr:load  @prefresh/core [__fallback__]
  wmr:transform.js  @prefresh/core -> /@npm/@prefresh/core
  wmr:resolve  ./pages/Home -> /mnt/c/path/to/project/public/pages/Home/index.js [resolve-extensions-plugin]
  wmr:transform.js  ./pages/Home -> ./pages/Home/index.js
  wmr:cache  write index.js
  wmr:middleware  <-- ./index.js as application/javascript;charset=utf-8
  wmr:middleware  /_wmr.js -> ./_wmr.js file: /mnt/c/path/to/project/public/_wmr.js
  wmr:middleware  <-- ./_wmr.js as application/javascript
  middleware:npm  "htm/preact"
  npm:plugin  htm/preact -> npm/[email protected]/preact/index.module.js
  middleware:npm  "preact/debug"
  npm:plugin  preact/debug -> npm/[email protected]/debug/dist/debug.module.js
  middleware:npm  "preact"
  npm:plugin  preact -> npm/[email protected]/dist/preact.module.js
  middleware:npm  "preact-iso"
  middleware:npm  "rgui-preact-core"
  middleware:npm  "rgui-preact-core/core"
  npm:plugin  preact-iso -> npm/[email protected]/index.js
  npm:plugin  ./router.js -> npm/[email protected]/router.js
  npm:plugin  ./lazy.js -> npm/[email protected]/lazy.js
  npm:plugin  ./hydrate.js -> npm/[email protected]/hydrate.js
  npm:plugin  ./prerender.js -> npm/[email protected]/prerender.js
  wmr:middleware  /pages/Home/index.js -> ./pages/Home/index.js file: /mnt/c/path/to/project/public/pages/Home/index.js
  wmr:middleware  /pages/_404.js -> ./pages/_404.js file: /mnt/c/path/to/project/public/pages/_404.js
  wmr:middleware  /style.less -> ./style.less file: /mnt/c/path/to/project/public/style.less
  wmr:load  ./style.less [__fallback__]
  npm:plugin  rgui-preact-core -> npm/[email protected]/dist/rgui-preact-core.cjs.js
  wmr:resolve  ./pages/Home/index.js -> /mnt/c/path/to/project/public/pages/Home/index.js [resolve-extensions-plugin]
  wmr:load  /mnt/c/path/to/project/public/pages/Home/index.js [__fallback__]
  wmr:resolve  ./pages/_404.js -> /mnt/c/path/to/project/public/pages/_404.js [resolve-extensions-plugin]
  wmr:load  /mnt/c/path/to/project/public/pages/_404.js [__fallback__]
  npm:plugin  rgui-preact-core/core -> npm/[email protected]/dist/esm/core/_index.js
  wmr:transform  ./style.less [less]
  wmr:cache  write style.less?asset
  wmr:transform  ./style.less [wmr-styles]
  wmr:cache  write style.less
  wmr:middleware  <-- ./style.less as application/javascript;charset=utf-8
  wmr:transform  ./pages/Home/index.js [preact-prefresh]
  wmr:transform  ./pages/Home/index.js [import-assertion]
  wmr:transform  ./pages/Home/index.js [process-global]
  wmr:transform  ./pages/Home/index.js [htm-plugin]
  wmr:transform  ./pages/Home/index.js [wmr]
  wmr:transform  ./pages/Home/index.js [default-loaders]
  wmr:transform  ./pages/_404.js [preact-prefresh]
  wmr:transform  ./pages/_404.js [import-assertion]
  wmr:transform  ./pages/_404.js [process-global]
  wmr:transform  ./pages/_404.js [htm-plugin]
  wmr:transform  ./pages/_404.js [wmr]
  wmr:transform  ./pages/_404.js [default-loaders]
  npm:plugin  ./PageLifecycle.js -> npm/[email protected]/dist/esm/core/PageLifecycle.js
  middleware:npm  "htm"
  npm:plugin  htm -> npm/[email protected]/dist/htm.module.js
  middleware:npm  "@prefresh/core"
  middleware:npm  "preact/devtools"
  wmr:load  prop-types [__fallback__]
  wmr:transform.js  prop-types -> /@npm/prop-types
  wmr:load  htm/preact [__fallback__]
  wmr:transform.js  htm/preact -> /@npm/htm/preact
  wmr:load  @prefresh/core [__fallback__]
  wmr:transform.js  @prefresh/core -> /@npm/@prefresh/core
  wmr:load  rgui-preact-core/components [__fallback__]
  wmr:transform.js  rgui-preact-core/components -> /@npm/rgui-preact-core/components
  wmr:load  @prefresh/core [__fallback__]
  wmr:transform.js  @prefresh/core -> /@npm/@prefresh/core
  wmr:load  htm/preact [__fallback__]
  wmr:transform.js  htm/preact -> /@npm/htm/preact
  wmr:cache  write pages/_404.js
  wmr:middleware  <-- ./pages/_404.js as application/javascript;charset=utf-8
  middleware:npm  "preact/hooks"
  npm:plugin  preact/devtools -> npm/[email protected]/devtools/dist/devtools.module.js
  wmr:load  preact [__fallback__]
  wmr:transform.js  preact -> /@npm/preact
  wmr:cache  write pages/Home/index.js
  wmr:middleware  <-- ./pages/Home/index.js as application/javascript;charset=utf-8
  npm:plugin  preact/hooks -> npm/[email protected]/hooks/dist/hooks.module.js
  middleware:npm  "rgui-preact-core/components"
  npm:plugin  @prefresh/core -> npm/@prefresh/[email protected]/src/index.js
  npm:plugin  rgui-preact-core/components -> npm/[email protected]/dist/esm/components/_index.js
  middleware:npm  "prop-types"
  npm:plugin  ./Content.js -> npm/[email protected]/dist/esm/components/Content.js
  npm:plugin  ./Icon.js -> npm/[email protected]/dist/esm/components/Icon.js
  npm:plugin  ./Layout.js -> npm/[email protected]/dist/esm/components/Layout.js
  npm:plugin  ./Ripple.js -> npm/[email protected]/dist/esm/components/Ripple.js
  npm:plugin  ./Toolbar.js -> npm/[email protected]/dist/esm/components/Toolbar.js
  npm:plugin  ./style-inject.es-d4c17b33.js -> npm/[email protected]/dist/esm/components/style-inject.es-d4c17b33.js
  npm:plugin  ./PreactHelpers-db4eb46d.js -> npm/[email protected]/dist/esm/components/PreactHelpers-db4eb46d.js
  npm:plugin  ./index-6b312cf6.js -> npm/[email protected]/dist/esm/components/index-6b312cf6.js
  npm:plugin  ./Misc-98280791.js -> npm/[email protected]/dist/esm/components/Misc-98280791.js
  npm:plugin  ./runtime/catchError -> npm/@prefresh/[email protected]/src/runtime/catchError.js
  npm:plugin  ./runtime/unmount -> npm/@prefresh/[email protected]/src/runtime/unmount.js
  npm:plugin  ./runtime/vnode -> npm/@prefresh/[email protected]/src/runtime/vnode.js
  npm:plugin  ./runtime/debounceRendering -> npm/@prefresh/[email protected]/src/runtime/debounceRendering.js
  npm:plugin  ./constants -> npm/@prefresh/[email protected]/src/constants.js
  npm:plugin  ./runtime/vnodesForComponent -> npm/@prefresh/[email protected]/src/runtime/vnodesForComponent.js
  npm:plugin  ./runtime/signaturesForType -> npm/@prefresh/[email protected]/src/runtime/signaturesForType.js
  npm:plugin  ./computeKey -> npm/@prefresh/[email protected]/src/computeKey.js
  npm:plugin  ./runtime/signaturesForType -> npm/@prefresh/[email protected]/src/runtime/signaturesForType.js
  npm:plugin  ./style-inject.es-d4c17b33.js -> npm/[email protected]/dist/esm/components/style-inject.es-d4c17b33.js
  npm:plugin  ./style-inject.es-d4c17b33.js -> npm/[email protected]/dist/esm/components/style-inject.es-d4c17b33.js
  npm:plugin  ./index-6b312cf6.js -> npm/[email protected]/dist/esm/components/index-6b312cf6.js
  npm:plugin  ./PreactHelpers-db4eb46d.js -> npm/[email protected]/dist/esm/components/PreactHelpers-db4eb46d.js
  npm:plugin  ./style-inject.es-d4c17b33.js -> npm/[email protected]/dist/esm/components/style-inject.es-d4c17b33.js
  npm:plugin  ./index-6b312cf6.js -> npm/[email protected]/dist/esm/components/index-6b312cf6.js
  npm:plugin  ./Misc-98280791.js -> npm/[email protected]/dist/esm/components/Misc-98280791.js
  npm:plugin  ./PreactHelpers-db4eb46d.js -> npm/[email protected]/dist/esm/components/PreactHelpers-db4eb46d.js
  npm:plugin  ./style-inject.es-d4c17b33.js -> npm/[email protected]/dist/esm/components/style-inject.es-d4c17b33.js
  npm:plugin  ./PreactHelpers-db4eb46d.js -> npm/[email protected]/dist/esm/components/PreactHelpers-db4eb46d.js
  npm:plugin  ./style-inject.es-d4c17b33.js -> npm/[email protected]/dist/esm/components/style-inject.es-d4c17b33.js
  npm:plugin  ./index-6b312cf6.js -> npm/[email protected]/dist/esm/components/index-6b312cf6.js
  npm:plugin  ./Misc-98280791.js -> npm/[email protected]/dist/esm/components/Misc-98280791.js
  npm:plugin  ./PreactHelpers-db4eb46d.js -> npm/[email protected]/dist/esm/components/PreactHelpers-db4eb46d.js
  npm:plugin  ../constants -> npm/@prefresh/[email protected]/src/constants.js
  npm:plugin  ../constants -> npm/@prefresh/[email protected]/src/constants.js
  npm:plugin  ./vnodesForComponent -> npm/@prefresh/[email protected]/src/runtime/vnodesForComponent.js
  npm:plugin  ./vnodesForComponent -> npm/@prefresh/[email protected]/src/runtime/vnodesForComponent.js
  npm:plugin  ../constants -> npm/@prefresh/[email protected]/src/constants.js
  npm:plugin  prop-types -> npm/[email protected]/index.js
  npm:plugin  ./factoryWithTypeCheckers -> npm/[email protected]/factoryWithTypeCheckers.js
  npm:plugin  ./factoryWithTypeCheckers -> npm/[email protected]/factoryWithTypeCheckers.js
  npm:plugin  [email protected]/factoryWithTypeCheckers.js -> npm/[email protected]/factoryWithTypeCheckers.js
  npm:plugin  ./lib/ReactPropTypesSecret -> npm/[email protected]/lib/ReactPropTypesSecret.js
  npm:plugin  ./lib/has -> npm/[email protected]/lib/has.js
  npm:plugin  ./lib/ReactPropTypesSecret -> npm/[email protected]/lib/ReactPropTypesSecret.js
  npm:plugin  [email protected]/lib/ReactPropTypesSecret.js -> npm/[email protected]/lib/ReactPropTypesSecret.js
  npm:plugin  ./checkPropTypes -> npm/[email protected]/checkPropTypes.js
  npm:plugin  ./checkPropTypes -> npm/[email protected]/checkPropTypes.js
  npm:plugin  [email protected]/checkPropTypes.js -> npm/[email protected]/checkPropTypes.js
  npm:plugin  ./lib/has -> npm/[email protected]/lib/has.js
  npm:plugin  [email protected]/lib/has.js -> npm/[email protected]/lib/has.js
  npm:plugin  ./lib/ReactPropTypesSecret -> npm/[email protected]/lib/ReactPropTypesSecret.js
  npm:plugin  ./lib/has -> npm/[email protected]/lib/has.js
  npm:plugin  ./lib/has -> npm/[email protected]/lib/has.js
  npm:plugin  ./lib/ReactPropTypesSecret -> npm/[email protected]/lib/ReactPropTypesSecret.js
  middleware:npm  "object-assign"
  npm:plugin  object-assign -> npm/[email protected]/index.js

404 /@npm/@npm/react-is - npm registry lookup failed for "@npm/react-is": Package doesn't exist.

  at TT (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1194284)
  at  (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1239595)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async KR (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1239205)
  at async HR (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:1239084)
  at async Array.<anonymous> (/mnt/c/path/to/project/node_modules/wmr/wmr.cjs:2:2934077)

@Aloento
Copy link

Aloento commented Apr 12, 2022

maybe same with #919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compat CJS/UMD/etc
Projects
None yet
Development

No branches or pull requests

3 participants