Open marketdevsoft opened 4 years ago
What version of the TypeScript compiler you have?
running in the same problem, I took the example, yarn;yarn start and I get this...
should I use a specific version ?
ts-loader: Using typescript@3.8.3 and /home/mauro/Downloads/charting-library-examples/react-typescript/tsconfig.json
(76,3): 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'.
https://github.com/tradingview/charting_library/blob/master/datafeeds/udf/src/symbols-storage.ts#L76
is this unstable version available ?
We can guarantee success compilation of UDF datafeed only for TypeScript version we provided that package. We update that version as soon we update our project, but you can easily fix it for yourself because UDF datafeed provided with source code and basically should be in your repo (as soon it's just example of datafeed).
@timocov I got this, just need to force "typescript": "3.3.1"
to match with the UDF
@marketdevsoft add - 'as ExchangeDataResponseSymbolData' to the return statement in src/assets/datafeeds/udf/src/symbols-storage.ts:76:3
Hi, i'm new and i try to install charting_library into angular (8.3.24), following this step: https://github.com/tradingview/charting-library-examples/blob/master/angular5/README.md. But when i run ng serve it fails with those errors: ERROR in src/assets/datafeeds/udf/src/symbols-storage.ts:76: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'.
76 return value[arrayIndex];