cacheable
cacheable copied to clipboard
Could not find a declaration file for module 'http-cache-semantics'
Describe the bug
When using [email protected] in my TypeScript project, I get the following error when trying to compile it:
maxim@ubuntu:~/google-api-typings-generator$ tsc
node_modules/cacheable-request/dist/types.d.ts:7:35 - error TS7016: Could not find a declaration file for module 'http-cache-semantics'. '/home/maxim/google-api-typings-generator/node_modules/http-cache-semantics/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/http-cache-semantics` if it exists or add a new declaration (.d.ts) file containing `declare module 'http-cache-semantics';`
7 import { CachePolicyObject } from 'http-cache-semantics';
~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in node_modules/cacheable-request/dist/types.d.ts:7
How To Reproduce (best to provide workable code or tests!) The problem is currently present in this PR: https://github.com/Maxim-Mazurok/google-api-typings-generator/pull/709
git clone -b create-pr-action/chore-npm-dedupe-0 https://github.com/Maxim-Mazurok/google-api-typings-generatorcd google-api-typings-generator- optional
nvm i npm ci- Observe the error
@Maxim-Mazurok - thanks for sending this over. I was looking at the node_modules/cacheable-request/dist/package.json and we do have @types/http-cache-semantics in there but seems to not be loading in the node_modules.
When I run npm i --save-dev @types/http-cache-semantics on the main project this goes away but there seems to be an issue.
@Maxim-Mazurok - published release 10.2.1 with your changes. Thanks so much for contributing 🎉
https://github.com/jaredwray/cacheable-request/releases/tag/v10.2.1