jest icon indicating copy to clipboard operation
jest copied to clipboard

[Bug]: inflight deprecated, glob deprecated

Open ChronoBoot opened this issue 1 year ago • 48 comments

Version

29.7.0

Steps to reproduce

npm i jest --save

Expected behavior

No warning

Actual behavior

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 [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported

Additional context

The inflight archive has not been updated since 8 years and has an alternative which is up to date https://www.npmjs.com/package/lru-cache The used glob version is deprecated and 2 years old

Is there specific reasons why these have not been replaced/updated ?

Environment

System:
    OS: macOS 14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
  Binaries:
    Node: 22.3.0 - ~/.nvm/versions/node/v22.3.0/bin/node
    Yarn: 1.22.22 - ~/.yarn/bin/yarn
    npm: 10.8.1 - ~/.nvm/versions/node/v22.3.0/bin/npm
    pnpm: 6.11.0 - ~/.nvm/versions/node/v14.19.0/bin/pnpm
  npmPackages:
    jest: ^29.7.0 => 29.7.0

ChronoBoot avatar Jul 09 '24 12:07 ChronoBoot

#14509 should remove this warning.

qbantek avatar Jul 19 '24 20:07 qbantek

There is also a memory leak issue in inflight that is not patched image

Jme797 avatar Aug 16 '24 08:08 Jme797

Seeing the distributed package jest-config 29.7.0, it seems that jest-config is still dependent on glob ^7.1.3

This is the package.json taken from an installation in a project of mine: package.json

belinde avatar Sep 04 '24 09:09 belinde

jest/reporters v29.7.0 is still depending on glob ^7.1.3 and is causing the dependency along with inflight to be pulled into projects requiring jest v29.7.0: https://github.com/jestjs/jest/blob/4e56991693da7cd4c3730dc3579a1dd1403ee630/packages/jest-reporters/package.json#L25

wingedthing avatar Sep 05 '24 20:09 wingedthing

I am getting the following warning in my NestJS backend project. Even after updating all the packages, I am still encountering this warning. Is there anyone who can help me get rid of it?

PS F:\Test_project\rescueworld-microservice-retteracademy> npm i 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 [email protected]: Glob versions prior to v9 are no longer supported npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported

Screenshot 2024-09-03 162641

ankitbavne avatar Sep 09 '24 10:09 ankitbavne

I am getting the following warning in my NestJS backend project. Even after updating all the packages, I am still encountering this warning. Is there anyone who can help me get rid of it?

@ankitbavne If you're on npm version 8 or higher, you can use overrides in your package.json:

  "overrides": {
    "glob": "10.4.2" 
  }

This will force jest to use that version in your build.

wingedthing avatar Sep 09 '24 15:09 wingedthing

@wingedthing Is it safe to use overrides ?

ankitbavne avatar Sep 11 '24 08:09 ankitbavne

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Oct 11 '24 09:10 github-actions[bot]

Waiting for the fix

msaeedsaeedi avatar Oct 16 '24 08:10 msaeedsaeedi

waiting for the fix

LvckyAPI avatar Oct 21 '24 12:10 LvckyAPI

Waiting for fix

maka-io avatar Oct 31 '24 16:10 maka-io

Waiting for fix. thank you

crisu avatar Nov 01 '24 10:11 crisu

Waiting for fix. thank you

danilobraga-loft avatar Nov 11 '24 19:11 danilobraga-loft

Bumping to keep this unfixed issue alive.

ahakkar avatar Dec 09 '24 21:12 ahakkar

Waiting on a fix

mtycholaz avatar Dec 14 '24 21:12 mtycholaz

Looks like jest-reporters has updated to glob 10 in the 30.0.0 alpha, but the old version is still pulled in by babel-plugin-istanbul: https://github.com/istanbuljs/babel-plugin-istanbul/issues/294

vpzomtrrfrt avatar Dec 14 '24 21:12 vpzomtrrfrt

Here is my dependency:

@nx/[email protected]
  └─┬ @jest/[email protected]
    └─┬ [email protected]
      └── [email protected]

ThePlenkov avatar Dec 23 '24 15:12 ThePlenkov

Waiting on a fix

lsaudon avatar Jan 13 '25 15:01 lsaudon

Waiting on a fix

odbalogun avatar Jan 16 '25 19:01 odbalogun

what is going on with these comments?

vpzomtrrfrt avatar Jan 16 '25 19:01 vpzomtrrfrt

i honestly don't know from where it comes - but I noticed that in yarn.lock there was still a reference to inflight packages used by outdated glob versions. So I created MR to override the version to 10.3.10 which is used currently in the project, but not sure if it will actually impact published packages because I don't know how jest is publishing them. I see that build folder gets created right in packages - and it shares original package.json of the subpackage with a built code. Therefore to resolve glob properly i guess we also need to do something with that package.json too ( or with yarn.lock of that published package probably ).

ThePlenkov avatar Jan 17 '25 10:01 ThePlenkov

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Feb 16 '25 11:02 github-actions[bot]

bump

NickSmet avatar Feb 16 '25 11:02 NickSmet

News on this?

byjokese avatar Mar 01 '25 11:03 byjokese

Waiting on a fix.

E5-Aaron avatar Mar 03 '25 19:03 E5-Aaron

Waiting on a fix.

AllanCapistrano avatar Mar 05 '25 19:03 AllanCapistrano

I followed these steps:

  1. Override glob version (which is 11.0.1) in package.json
  "overrides": {
    "glob": "11.0.1"
  },
  1. $ rm -rf ./node_modules/
  2. $ npm install

Seems there is no inflight anymore

$ npm ls inflight └── (empty)

$ npm why inflight npm ERR! No dependencies found matching inflight

Hope it helps!

Karimai avatar Mar 16 '25 16:03 Karimai

is anyone going to update this issue? Not sure if the maintainers are aware if it has gone this long.

mebanS-rdc avatar Mar 21 '25 05:03 mebanS-rdc

Apparently it was fixed fifteen months ago by #14509, but that won't be released until v30. 🤷‍♂

reduckted avatar Mar 21 '25 08:03 reduckted

I'm basically a n00b at modern frontend development, having largely stayed away from frontend since the naughties, but it is a little bit of a shocker to me to discover that something famous enough that even I've heard of it - jest - includes a long-deprecated package with memory leaks. Worse, when I look at where this dependency is introduced, it turns out it is coming from the glob package, which is today on major 11, while jest is stuck with version 7.

Maybe this is "normal" in this brave new world where one moves fast and breaks things, IDK. But since you guys clearly have been aware of the issue for some time, I am hopeful that you are actually going to provide a fix sometime soon..?

Does anyone know when v30 is supposed to be released? Since it's a new major I expect breaking changes, but since the contract between jest its users is all about the tests, it's hard to imagine a difficult upgrade path (anything is possible, I suppose, but my guess would be that the breaking changes are a few minor things and many users will be able to upgrade without making any other changes)..?

thedag avatar Apr 01 '25 07:04 thedag