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

package.json incorrectly defines location of Typescript types #6611

Closed
mmakrzem opened this issue Sep 22, 2021 · 2 comments
Closed

package.json incorrectly defines location of Typescript types #6611

mmakrzem opened this issue Sep 22, 2021 · 2 comments
Labels

Comments

@mmakrzem
Copy link

mmakrzem commented Sep 22, 2021

Bug Report

Current Behavior
Installed rxjs into my TypeScript project. Tried using rxjs but the TypeScript compiler gave me an error message saying

Could not find a declaration file for module 'rxjs'.
'D:/myWork/node_modules/rxjs/dist/cjs/index.js' implicitly has an 'any'
type.Try npm i --save-dev @types/rxjs if it exists or add a new declaration (.d.ts) file containing
declare module 'rxjs';

Expected behavior
TypeScript should be able to find the types defined inside the rxjs project.

Environment

  • RxJS version: 7.3.0
  • TypeScript v4.4.3
  • npm v7.18.1
  • node v14.15.3

Possible Solution
I had a look in rxjs's package.json file and I see
"types": "index.d.ts"

This is incorrect. If I change this line to the following then everything starts working again.

"types": "./dist/types/index.d.ts"

I don't know why the "typesVersions" settings don't work.

@kwonoj
Copy link
Member

kwonoj commented Sep 22, 2021

It is not incorrect: #6466 (comment)

If you see this issue on tsc > 4.2.4, please provide reproducible repo.

@kwonoj kwonoj added the blocked label Sep 22, 2021
@kwonoj
Copy link
Member

kwonoj commented Jan 19, 2023

Closing as inactive.

@kwonoj kwonoj closed this as completed Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants