Sherveeen
Sherveeen

Reputation: 81

Angular Library Compilation: ERROR: Cannot read property 'then' of undefined

I have an angular 11 workspace with several projects (libraries). Recently I added a new component to a library, and the compilation was all OK. After exposing the new component in my public-api.ts file, I am getting this one-line and non-sense error when compiling my library (with ng build my-lib command):

ERROR: Cannot read property 'then' of undefined

Has anybody encountered this issue? Please help!

public-api.ts latest change:

export * from './lib/ray-autocomplete/ray-autocomplete.module';
export * from './lib/ray-autocomplete/ray-autocomplete.component';

Upvotes: 2

Views: 2419

Answers (1)

Sherveeen
Sherveeen

Reputation: 81

This was my fault when copying the new component from another component; I forgot to rename the files at @Component declaration:

@Component({
  selector: 'ray-autocomplete',
  templateUrl: './ray-autocomplete.component.html', 
  styleUrls: ['./ray-autocomplete.component.css'], 

But the error was very misleading.

Upvotes: 5

Related Questions