You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TS7016: Could not find a declaration file for module 'redis-errors' (since 6.1.0) #2319
Since 6.1.0, tsc reports errors in the ioredis type declarations when the project has strict (or noImplicitAny) enabled and skipLibCheck disabled. 6.0.0 works.
node_modules/ioredis/built/errors/MaxRetriesPerRequestError.d.ts(1,28): error TS7016: Could not find a declaration file for module 'redis-errors'. '.../node_modules/redis-errors/index.js' implicitly has an 'any' type.
node_modules/ioredis/built/errors/WatchError.d.ts(1,28): error TS7016: Could not find a declaration file for module 'redis-errors'. '.../node_modules/redis-errors/index.js' implicitly has an 'any' type.
Expected: tsc passes without installing @types/redis-errors in the project, as with 6.0.0.
Cause
#2165 re-exported WatchError and MaxRetriesPerRequestError from the package entry point. Their declaration files import redis-errors, which does not include type declarations, and @types/redis-errors is only in the devDependencies of ioredis.
As a workaround, you can install @types/redis-errors in your project, or set skipLibCheck: true.
Proposed fix
I'd suggest moving @types/redis-errors from devDependencies to dependencies.
@benevolent0505#2322 fixes this by keeping redis-errors out of the published declarations of WatchError and MaxRetriesPerRequestError, so your project won't need @types/redis-errors. We considered moving @types/redis-errors into dependencies, but that would install an @types package for every user, including plain-JS ones, which felt like poor package hygiene. Ideally we'd drop redis-errors entirely, but replacing its classes changes instanceof behavior, so that has to wait for a major release.
With your exact package.json and tsconfig.json, tsc reports both TS7016 errors on 6.1.0 and passes on a tarball built from the branch. instanceof AbortError still returns true for both errors.
Would you mind reviewing the PR and letting us know whether this approach works for your setup?
@PavelPashov I confirmed that this approach resolves the TS7016 errors in my setup. I agree with not moving @types/redis-errors into dependencies.
Thanks for the quick fix!
Activity
rome-xi commentedon Dec 1, 2026
I can reproduce this on 466f6be; working on a fix with a test.
PavelPashov commentedon Dec 1, 2026
@benevolent0505 Thank you for reporting this, I've reproduce it and will look into it
PavelPashov commentedon Dec 1, 2026
@benevolent0505 #2322 fixes this by keeping
redis-errorsout of the published declarations ofWatchErrorandMaxRetriesPerRequestError, so your project won't need@types/redis-errors. We considered moving@types/redis-errorsintodependencies, but that would install an@typespackage for every user, including plain-JS ones, which felt like poor package hygiene. Ideally we'd dropredis-errorsentirely, but replacing its classes changesinstanceofbehavior, so that has to wait for a major release.With your exact
package.jsonandtsconfig.json,tscreports both TS7016 errors on 6.1.0 and passes on a tarball built from the branch.instanceof AbortErrorstill returnstruefor both errors.Would you mind reviewing the PR and letting us know whether this approach works for your setup?
benevolent0505 commentedon Dec 1, 2026
@PavelPashov I confirmed that this approach resolves the TS7016 errors in my setup. I agree with not moving
@types/redis-errorsintodependencies.Thanks for the quick fix!
github-actions commentedon Dec 2, 2026
🎉 This issue has been resolved in version 6.1.1 🎉
The release is available on:
v6.1.1Your semantic-release bot 📦🚀