the Timeseries data has datapoints of type “TimeseriesDatapoint”. However, looking at the timeseries interface I see the following:
export interface Timeseries {
/** The datapoints recordset for this time series */
datapoints: [];
/** The name or names in case of multiple dimensions for the time series */
name: string | string[];
/** Unit token for the value represented by the timeseries datapoints. Eg: 'kbit/s' */
unit?: TimeseriesUnit;
/** Custom data to be added to a Timeseries series payload */
userData?: Record<string, any>;
}
sloChartDataPoints is of type Array<TimeseriesDatapoint>.
The error I get is:
Type ‘TimeseriesDatapoint[]’ is not assignable to type ‘[]’.Target allows only 0 element(s) but source may have more.ts(2322)timeseries.d.ts(26, 5): The expected type comes from property ‘datapoints’ which is declared here on type 'Timeseries’What am I missing?
export interface Timeseries {
/** The datapoints recordset for this time series */
datapoints: TimeseriesDatapoint[];
/** The name or names in case of multiple dimensions for the time series */
name: string | string[];
/** Unit token for the value represented by the timeseries datapoints. Eg: 'kbit/s' */
unit?: TimeseriesUnit;
/** Custom data to be added to a Timeseries series payload */
userData?: Record<string, any>;
}
The only way I’ve found to reproduce this issue is by manually removing the TimeseriesDatapoint type in the Timeseries type definition. Is it possible this happened by mistake?
Try reinstalling it maybe it’ll fix it: npm install @dynatrace/strato-components-preview@latest
It’s definitely not the way to go, and everything looks fine on our end, so I’m not sure how to proceed. Is this a new app you just created? Can you try creating a new app from scratch and checking the type definition?
In the emanwhile I kept the manual changes, while I know it’s not the way to go, but just didn’t have the time to try and create a new app. In my case it wasn’t a new app. The upgrade of the version did add the migration comment to my code warning me about the change, so I assume it has something to do wilth the my specific windows environment.