Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find a declaration file for module 'http-cache-semantics' #194

Closed
Maxim-Mazurok opened this issue Sep 25, 2022 · 2 comments · Fixed by #195
Closed

Could not find a declaration file for module 'http-cache-semantics' #194

Maxim-Mazurok opened this issue Sep 25, 2022 · 2 comments · Fixed by #195
Labels

Comments

@Maxim-Mazurok
Copy link
Contributor

Describe the bug
When using cacheable-request@10.2.0 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: Maxim-Mazurok/google-api-typings-generator#709

  1. git clone -b create-pr-action/chore-npm-dedupe-0 https://github.com/Maxim-Mazurok/google-api-typings-generator
  2. cd google-api-typings-generator
  3. optional nvm i
  4. npm ci
  5. Observe the error
@jaredwray
Copy link
Owner

@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.

@jaredwray
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants