question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not find a declaration file for module '@reactivex/rxjs' (5.5.x)

See original GitHub issue

RxJS version: 5.5.0, 5.5.1, 5.5.2

Code to reproduce: index.ts

import { Subject } from "@reactivex/rxjs";

const test = new Subject<boolean>();

test.next(true);

package.json

{
  "dependencies": {
    "@reactivex/rxjs": "5.5.0",
    "typescript": "^2.5.3"
  }
}

*tsconfig.json*
```json
{
    "compilerOptions": {
        "noImplicitAny": true
    }
}

Expected behavior: No errors.

Actual behavior:

index.ts(1,25): error TS7016: Could not find a declaration file for module ‘@reactivex/rxjs’. ‘C:/Users/mattd/Source/Examples/rxjs-bug/node_modules/@reactivex/rxjs/index.js’ implicitly has an ‘any’ type. Try npm install @types/@reactivex/rxjs if it exists or add a new declaration (.d.ts) file containing declare module '@reactivex/rxjs';

Additional information: The package.json of rxjs contains "typings": "./dist/package/typings/Rx.d.ts", but there is no typings folder in the package directory. I expect that it should be changed to "typings": "./dist/typings/Rx.d.ts", because that appears to work.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
davideastcommented, Oct 30, 2017

Thanks for taking the time to file the issue @mdekrey! I confirmed this myself. The package.json needs to point to "typings": "./dist/typings/Rx.d.ts", or typings needs to be in ./dist/package.

Thoughts @benlesh?

0reactions
lock[bot]commented, Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find a declaration file for module 'rxjs' - Stack Overflow
the error was show only on the vscode and not on the tsc in the terminal. so i understood that the problem was...
Read more >
could not find a declaration file for module 'rxjs'. - You.com
React Typescript throws the error, could not find a declaration file for module, due to number of reasons. Check out the possible solutions...
Read more >
Installation Instructions - RxJS
If you receive an error like error TS2304: Cannot find name 'Promise' or error TS2304: Cannot find name 'Iterable' when using RxJS you...
Read more >
rxjs - npm
Reactive Extensions for modern JavaScript. Latest version: 7.8.0, last published: 10 days ago. Start using rxjs in your project by running ...
Read more >
How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d. · declare module 'XYZ';. Lastly, you also need to add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found