jest
jest copied to clipboard
[Bug]: inflight deprecated, glob deprecated
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
#14509 should remove this warning.
There is also a memory leak issue in inflight that is not patched
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
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
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
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 Is it safe to use overrides ?
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.
Waiting for the fix
waiting for the fix
Waiting for fix
Waiting for fix. thank you
Waiting for fix. thank you
Bumping to keep this unfixed issue alive.
Waiting on a fix
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
Here is my dependency:
@nx/[email protected]
└─┬ @jest/[email protected]
└─┬ [email protected]
└── [email protected]
Waiting on a fix
Waiting on a fix
what is going on with these comments?
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 ).
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.
bump
News on this?
Waiting on a fix.
Waiting on a fix.
I followed these steps:
- Override glob version (which is 11.0.1) in package.json
"overrides": {
"glob": "11.0.1"
},
- $
rm -rf ./node_modules/ - $
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!
is anyone going to update this issue? Not sure if the maintainers are aware if it has gone this long.
Apparently it was fixed fifteen months ago by #14509, but that won't be released until v30. 🤷♂
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)..?