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

Types are broken #84

Closed
mohd-akram opened this issue Feb 23, 2024 · 2 comments
Closed

Types are broken #84

mohd-akram opened this issue Feb 23, 2024 · 2 comments

Comments

@mohd-akram
Copy link

To reproduce:

package.json:

{
  "type": "module",
  "dependencies": {
    "fetch-cookie": "^3.0.0",
    "typescript": "^5.3.3"
  }
}

main.ts:

import fetchCookie from 'fetch-cookie';
export default fetchCookie;

Run node_modules/.bin/tsc -m node16 --noEmit --strict main.ts

Output:

main.ts:1:25 - error TS7016: Could not find a declaration file for module 'fetch-cookie'. '/private/tmp/fetch-cookie-test/node_modules/fetch-cookie/esm/index.js' implicitly has an 'any' type.
  There are types at '/private/tmp/fetch-cookie-test/node_modules/fetch-cookie/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'fetch-cookie' library may need to update its package.json or typings.

1 import fetchCookie from 'fetch-cookie';
                          ~~~~~~~~~~~~~~


Found 1 error in main.ts:1
@valeriangalliat
Copy link
Owner

Thanks for reporting! This should be fixed with 3.0.1, let me know :)

@mohd-akram
Copy link
Author

Thanks, works now!

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

No branches or pull requests

2 participants