vitejs / vite

Next generation frontend tooling. It's fast!
http://vitejs.dev
MIT License
67.08k stars 6.02k forks source link

Deprecated `inflight` dependency #17306

Closed MaxioTech closed 1 month ago

MaxioTech commented 3 months ago

Describe the bug

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

"npm WARN deprecated inflight@1.0.6: 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

exceedxo commented 3 months ago

Same issue here

bluwy commented 3 months ago

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

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.

swasthik-007 commented 3 months ago

what do i do now???

bluwy commented 3 months ago

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?

swasthik-007 commented 3 months ago

okay Thank You

ajibadey405 commented 3 months ago

What's the solution to the above error?

lorand-horvath commented 3 months ago

@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"
    }
  }
adewaleftk commented 3 months ago

npm warn deprecated inflight@1.0.6: 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

lorand-horvath commented 3 months ago

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

Sophyane commented 3 months ago

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

Srossiprieto commented 3 months ago

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

bluwy commented 3 months ago

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 commented 2 months ago

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.

Srossiprieto commented 2 months ago

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

lorand-horvath commented 2 months ago

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"
    }
  }
edinoteK commented 2 months ago

я вот честно сюда когда захожу, вообще без плнятия , что где, мне б Русификатор...

chiragjain307 commented 2 months ago

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 inflight@1.0.6: 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/config-array@0.11.14: Use @eslint/config-array instead npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm WARN deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead

bluwy commented 1 month ago

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