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.

Error: Cannot find 'rxjs.imports.ts' in the compiled program. Has it been imported?

See original GitHub issue

I’m getting this error when running the linter:

Error: Cannot find '/path/to/app/src/rxjs.imports.ts' in the compiled program. Has it been imported?
    at Walker.findSourceFile (/path/to/app/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:136:15)
    at Walker.walkFile (/path/to/app/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:146:35)
    at Walker.onSourceFileEnd (/path/to/app/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:48:31)
    at Walker.AddedWalker.visitNode (/path/to/app/node_modules/rxjs-tslint-rules/dist/support/added-walker.js:41:18)
    at Walker.SyntaxWalker.walk (/path/to/app/node_modules/tslint/lib/language/walker/syntaxWalker.js:24:14)
    at Rule.AbstractRule.applyWithWalker (/path/to/app/node_modules/tslint/lib/language/rule/abstractRule.js:31:16)
    at Rule.applyWithProgram (/path/to/app/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:15:21)
    at Linter.applyRule (/path/to/app/node_modules/tslint/lib/linter.js:174:29)
    at /path/to/app/node_modules/tslint/lib/linter.js:119:85
    at Object.flatMap (/path/to/app/node_modules/tslint/lib/utils.js:151:29)

The linter found the errors though and I could fix the problems, but I’m still getting this. I have added the rxjs-add ruleset following the instructions in the README file and I’ve imported my rxjs.imports.ts file in main.ts, just like in the example code.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
cartantcommented, Mar 9, 2018

@bjohnson-va You shouldn’t need to remove tsconfig.e2e.json. Angular creates that file. It doesn’t - unless things have very recently changed - create a TSLint configuration file in the e2e directory. You can create that file to disable the RxJS-related rule (using TSLint’s relative-configuration-file mechanism).

I would not recommend removing tsconfig.e2e.json, even if you are not using end-to-end tests.

0reactions
bjohnson-vacommented, Mar 9, 2018

I don’t actually have any e2e tests at the moment, so removing my tsconfig.e2e.json and renaming tslint.e2e.json => tslint.json did the trick.

Thanks for the insight.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - can't Resolve rxjs - Stack Overflow
I got this error because of an older version of rxjs and Angular 6 needs the latest version of rxjs. This command installs...
Read more >
RXJS own d.ts file error · Issue #3654 · ReactiveX/rxjs - GitHub
This happens when you haven't updated other imports that require Subject etc. from the old location. Update the other imports in your other ......
Read more >
cannot find module 'rxjs/rx' - You.com | The AI Search Engine ...
I am using angular CLI and visual studio code. my suggested import for Observable is import { Observable } from 'rxjs/internal/observable'; although this ......
Read more >
Cannot find module 'rxjs-compat/Observable' error | bobbyhadz
To solve the error "Cannot find module 'rxjs-compat/Observable'", make sure to install the package by opening your terminal in your project's root directory...
Read more >
48 answers on StackOverflow to the most popular Angular ...
Angular exception: Can't bind to 'ngForIn' since it isn't a known native ... Importing lodash into angular2 + typescript application; How to detect...
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