charting-library-examples icon indicating copy to clipboard operation
charting-library-examples copied to clipboard

Compilation Error Regarding Datafeeds

Open maksimryapolov77 opened this issue 6 years ago • 2 comments

PS D:\src\angular\tradingview> ng build

ERROR in src/assets/datafeeds/udf/src/symbols-storage.ts:78:3 - error TS2322: Type 'string | number | boolean | string[]' is not assignable to type 'ExchangeDataResponseSymbolData[Field]'. Type 'string' is not assignable to type 'ExchangeDataResponseSymbolData[Field]'. Type 'string' is not assignable to type 'never'.

78 return value[arrayIndex]; ~~~~~~~~~~~~~~~~~~~~~~~~~ src/assets/datafeeds/udf/src/udf-compatible-datafeed-base.ts:244:74 - error TS2339: Property 'errmsg' does not exist on type 'UdfErrorResponse | UdfSearchSymbolsResponse'. Property 'errmsg' does not exist on type 'UdfSearchSymbolsResponse'.

244 logMessage(UdfCompatibleDatafeed: search symbols error=${response.errmsg}); ~~~~~~ src/assets/datafeeds/udf/src/udf-compatible-datafeed-base.ts:249:15 - error TS2345: Argument of type 'UdfErrorResponse | UdfSearchSymbolsResponse' is not assignable to parameter of type 'SearchSymbolResultItem[]'. Type 'UdfErrorResponse' is missing the following properties from type 'SearchSymbolResultItem[]': length, pop, push, concat, and 26 more.

249 onResult(response); ~~~~~~~~ src/assets/datafeeds/udf/src/udf-compatible-datafeed-base.ts:285:21 - error TS2345: Argument of type 'UdfErrorResponse | ResolveSymbolResponse' is not assignable to parameter of type 'LibrarySymbolInfo'. Type 'UdfErrorResponse' is missing the following properties from type 'LibrarySymbolInfo': name, full_name, description, type, and 7 more.

285 onResultReady(response); ~~~~~~~~

I'd like to integrate charting-library with angular 8. But I got some error such as above. I hope someone let me know what is my messy. Thanks for interesting.

maksimryapolov77 avatar Oct 12 '19 22:10 maksimryapolov77

What version of TypeScript you use? Looks like it's different that declared in src/assets/datafeeds/udf. If you use different version of TypeScript, you need to adopt the code of UDF datafeed as well.

timocov avatar Oct 15 '19 17:10 timocov

What version of TypeScript you use? Looks like it's different that declared in src/assets/datafeeds/udf. If you use different version of TypeScript, you need to adopt the code of UDF datafeed as well.

I am using 3.7.2. and also the same version on angular. But same issue mentioned above.

nareshsr avatar Sep 29 '20 04:09 nareshsr