0

I'm working on angular library and creating each component as independent modules. I have created own ErrorStateMatcher & error config and placed it in different folder (./errors) so I can reuse them in other components. I'm getting following errors when I put these files in different folder and import in input.component.ts. Note: no errors when include these files in input folder.

✖ Compiling with Angular sources in Ivy partial compilation mode.
error TS6059: File '[path to app]/projects/mint/errors/error-option.ngtypecheck.ts' is not under 'rootDir' '[path to app]/projects/mint/input'. 'rootDir' is expected to contain all source files

enter image description here

input.component.ts

import { MintErrorMatcher } from '../errors/error-option';
import { _MintInputBase } from '../errors/error-state';

@Component({
    selector: 'mint-input',
    ...
    providers: [
        {
            provide: ErrorStateMatcher,
            useClass: MintErrorMatcher,
        },
    ]
})

export class MintInputComponent extends _MintInputBase { ... }

Johnny
  • 261
  • 7
  • 22
  • Each of your components is located outside your src folder, [which is excellent](https://stackoverflow.com/questions/74012408/using-single-component-from-library-causes-lazy-loaded-modules-to-end-up-in-main). But I'd guess that your tsconfig.json still only includes the files inside the `src` folder. [Here's my tsconfig.json](https://github.com/MintPlayer/mintplayer-ng-bootstrap/blob/master/libs/mintplayer-ng-bootstrap/tsconfig.lib.json#L20) – Pieterjan May 07 '23 at 10:19

0 Answers0