vite icon indicating copy to clipboard operation
vite copied to clipboard

Deprecated `inflight` dependency

Open MaxioTech opened this issue 1 year ago • 6 comments

Describe the bug

Today when I was setting up a new project, I got the following message when installing dependencies:

"npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful."

Reproduction

npm create vite@latest

Steps to reproduce

Run 'npm install'

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
    Memory: 21.63 GB / 31.94 GB
Binaries:
   Node: 20.9.0 - C:\Program Files\nodejs\node.EXE
   npm: 10.5.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
   Edge: Spartan (44.19041.3636.0), Chromium (123.0.2420.97)
   Internet Explorer: 11.0.19041.3636
npmPackages:
   @vitejs/plugin-react-swc: ^3.5.0 => 3.7.0
   vite: ^5.2.0 => 5.2.11

Used Package Manager

npm

Logs

No response

Validations

MaxioTech avatar May 24 '24 18:05 MaxioTech

Same issue here

exceedxo avatar May 25 '24 14:05 exceedxo

In Vite's lockfile, inflight is used by glob v8 and v7, which both are used by various dependencies including:

  • @rollup/plugin-commonjs v25.0.4
  • npm-packlist v5.1.3
  • rimraf v3.0.2
  • rollup-plugin-license v3.4.0
  • stylus v0.63.0
  • sucrase v3.32.0

Some are probably dev deps, but just listing these from the lockfile, and we need to update them first before we can remove inflight from the dependencies.

bluwy avatar May 27 '24 03:05 bluwy

what do i do now???

swasthik-007 avatar May 27 '24 04:05 swasthik-007

Ignore it? It isn't breaking anything. Or you could try to see if the packages I mentioned above have moved away from inflight and if so, try to update them in Vite?

bluwy avatar May 27 '24 04:05 bluwy

okay Thank You

swasthik-007 avatar May 27 '24 09:05 swasthik-007

What's the solution to the above error?

ajibadey405 avatar May 28 '24 19:05 ajibadey405

@bluwy The issue is coming from eslint@8, dependency tree:

"eslint": "^8.57.0"
  "file-entry-cache": "^6.0.1"
    "flat-cache": "^3.0.4"
      "rimraf": "^3.0.2" - deprecated
        "glob": "^7.1.3" - deprecated
          "inflight": "^1.0.4" - deprecated, leaks memory

The only viable solution I see is vite updating to eslint@9. Or eslint@8 fixing their deps (bump to file-entry-cache@8).

Temporary workaround: add file-entry-cache override to package.json, delete package-lock.json and npm install

  "overrides": {
    "eslint": {
      "file-entry-cache": "^8.0.0"
    }
  }

lorand-horvath avatar May 31 '24 06:05 lorand-horvath

npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. . I just experienced this same issue few minutes ago on my Kali Linux OS

adewaleftk avatar Jun 03 '24 05:06 adewaleftk

Just use the workaround I described above in https://github.com/vitejs/vite/issues/17306#issuecomment-2141309450 eslint is a mess right now. v9 is barely 3% of all weekly downloads, but for the rest of us 97% still using v8, they won't fix it just because: https://github.com/eslint/eslint/issues/18528#issuecomment-2144861494

lorand-horvath avatar Jun 03 '24 10:06 lorand-horvath

Could we avoid the issue if we simply update Eslint to V9 ?

Sophyane avatar Jun 05 '24 12:06 Sophyane

So, by migrating to version 9, those warnings would disappear? If that's the case, we would only need to run the command globally?

Srossiprieto avatar Jun 05 '24 23:06 Srossiprieto

For eslint, which only comes from Vite's react templates, https://github.com/vitejs/vite/pull/12860 will migrate it to eslint v9, however there seems to be some blockers before we can do that.

bluwy avatar Jun 06 '24 06:06 bluwy

https://github.com/vitejs/vite/pull/17431 removes the inflight dependency that's bundled within Vite. However, I'll still keep this open for the eslint template case.

bluwy avatar Jun 10 '24 13:06 bluwy

Any news on this? If so, how should I go about removing these warnings? I don't know much about this; I appreciate the work you're doing. Thanks! @bluwy

Srossiprieto avatar Jun 24 '24 20:06 Srossiprieto

Any news on this? If so, how should I go about removing these warnings?

@Srossiprieto See the workaround I posted in https://github.com/vitejs/vite/issues/17306#issuecomment-2141309450

You could also override the @humanwhocodes deprecations, so if you don't want to see any eslint 8-related warnings anymore, add the following to package.json, delete node_modules and package-lock.json, then run npm install

  "overrides": {
    "eslint": {
      "@humanwhocodes/config-array": "npm:@eslint/config-array",
      "file-entry-cache": "^8.0.0"
    }
  }

lorand-horvath avatar Jun 25 '24 07:06 lorand-horvath

I am also getting the same warning First i run the command: "npm create vite@latest" to create a new npm project, after that when i run command "npm i", with the installation of node module i get these 5 warnings:

npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead

chiragjain307 avatar Jul 04 '24 17:07 chiragjain307

https://github.com/vitejs/vite/pull/12860 has been merged and released in create-vite 5.5.0, which bumps the eslint templates to v9

bluwy avatar Aug 07 '24 15:08 bluwy