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 ./src/rxjs.imports.ts

See original GitHub issue

Getting this error every time although it works and shows lint errors.


Error: Cannot find ./src/rxjs.imports.ts
    at Walker.findSourceFile (/Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:134:15)
    at Walker.walkFile (/Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:144:35)
    at Walker.onSourceFileEnd (/Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:48:31)
    at Walker.AddedWalker.visitNode (/Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/rxjs-tslint-rules/dist/support/added-walker.js:40:18)
    at Walker.SyntaxWalker.walk (/Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/tslint/lib/language/walker/syntaxWalker.js:24:14)
    at Rule.AbstractRule.applyWithWalker (/Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/tslint/lib/language/rule/abstractRule.js:31:16)
    at Rule.applyWithProgram (/Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/rxjs-tslint-rules/dist/rules/rxjsAddRule.js:15:21)
    at Linter.applyRule (/Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/tslint/lib/linter.js:176:29)
    at /Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/tslint/lib/linter.js:121:85
    at Object.flatMap (/Users/Herc/Documents/RADAR/RADAR-Dashboard/node_modules/tslint/lib/utils.js:151:29)

ERROR: /Users/Herc/Documents/RADAR/RADAR-Dashboard/src/app/components/charts/chart-base/chart-base.component.ts[78, 8]: RxJS add import is missing from ./src/rxjs.imports.ts: debounceTime

Also had to add "no-unused-variable": false, to tslint for "allowUnused": false to work properly.

Issue Analytics

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

github_iconTop GitHub Comments

cartantcommented, Sep 16, 2017

@herkulano You might be interested in this issue and this comment. It introduces a somewhat cleaner way of making the rxjs-add rule play nice with @angular/cli.

cartantcommented, Aug 23, 2017

The problem is that the Angular CLI runs TSLint three times:

  • first, with application files from src/;
  • then with the test files from src/;
  • and, finally, with files from e2e/.

If the central imports file is not included in the tests, it’s not available in the compiled TypeScript program that TSLint provides to the rules.

You can fix the problem by importing ./src/rxjs.imports.ts in test.ts:

import './rxjs.imports';

and in e2e/app.po.ts:

import '../src/rxjs.imports';

I’ll improve the error thrown by the rule to better describe the situation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tslint rxjs-tslint-rules Cannot find '/users/whisher/projects/my ...
Cannot find '/users/whisher/projects/my/src/rxjs-imports.ts' in the compiled program. Has it been imported? How can I fix it ? or is it ...
Read more >
ts-custom-error - npm
Start using ts-custom-error in your project by running `npm i ... import { CustomError } from 'ts-custom-error' class HttpError extends ...
Read more >
[Solved]-tslint rxjs-tslint-rules Cannot find '/users/whisher ...
Coding example for the question tslint rxjs-tslint-rules Cannot find '/users/whisher/projects/my/src/rxjs-imports.ts' in the compiled program.
Read more >
Import Statements in TypeScript: Which Syntax to Use
error TS1192 : Module '"thing"' has no default export. This means you tried to use import thing from "thing" but TS didn't find...
Read more >
Installation Instructions - RxJS
To import only what you need, please check out this guide. CommonJS via npmlink. If you receive an error like error TS2304: Cannot...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found