This is a migrated thread and some comments may be shown as answers.

Conversational UI

1 Answer 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 27 Sep 2018, 09:19 AM

Hello,

I am trying to use the conversational UI widget for Angular. Using the getting started instructions I created a Angular 5 application and installed the dependencies.  When I run the application I get the following error:

Argument of type 'UnaryFunction<Observable<any[]>, Observable<any[]>>' is not assignable to parameter of
type 'UnaryFunction<Observable<Message>, Observable<any[]>>'. Types of parameters 'source' and 'source' are
incompatible. Type 'Observable<Message>' is not assignable to type 'Observable<any[]>'. Type 'Message' is
not assignable to type 'any[]'. Property 'length' is missing in type 'Message'.
// ... and emit an array of all messages
scan((acc, x) => [...acc, x], [])
L64:  );

I have not been able to figure out why this error is occurring.  Any assistance would be greatly appreciated.

 

Scott

 

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 01 Oct 2018, 05:45 AM
Hi Scott,

The error seems like a TypeScript error, caused by a discrepancy between the expected and actual type as Message is provided where an array of any is expected (and as Message has different signature than the Array type, e.g. - a missing length property), the TypeScript compiler raises this error.

Here is a runnable sample application that is working as expected:

https://stackblitz.com/edit/angular-bbvd4d?file=app%2Fapp.component.ts

Can you please compare it to your implementation and apply the necessary adjustments? If the issue persists, please send us a similar isolated runnable project where the problem can be observed, so we can inspect it further and determine what might be causing it? Thank you in advance.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Scott
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or