I get the following type errors building the dynamic demo plugin: $ cd dynamic-demo-plugin $ yarn install $ yarn run build ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx 95:12-59 [tsl] ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(95,13) TS2345: Argument of type '{ model: K8sModel; queryParams: { ns: string; }; }' is not assignable to parameter of type 'OptionsList'. Property 'requestInit' is missing in type '{ model: K8sModel; queryParams: { ns: string; }; }' but required in type 'OptionsList'. ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx 97:21-29 [tsl] ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(97,22) TS2345: Argument of type 'K8sResourceCommon[] | (K8sResourceCommon & { items: K8sResourceCommon[]; })' is not assignable to parameter of type 'SetStateAction<K8sResourceCommon[]>'. Type 'K8sResourceCommon & { items: K8sResourceCommon[]; }' is not assignable to type 'SetStateAction<K8sResourceCommon[]>'. Type 'K8sResourceCommon & { items: K8sResourceCommon[]; }' is not assignable to type '(prevState: K8sResourceCommon[]) => K8sResourceCommon[]'. Type 'K8sResourceCommon & { items: K8sResourceCommon[]; }' provides no match for the signature '(prevState: K8sResourceCommon[]): K8sResourceCommon[]'. ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx 107:14-60 [tsl] ERROR in /Users/sam/work/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(107,15) TS2345: Argument of type '{ model: K8sModel; resource: { apiVersion: string; kind: string; metadata: { name: string; namespace: string; labels: { app: string; }; }; spec: { selector: { matchLabels: { app: string; }; }; replicas: number; template: { ...; }; }; }; }' is not assignable to parameter of type 'OptionsDelete<{ apiVersion: string; kind: string; metadata: { name: string; namespace: string; labels: { app: string; }; }; spec: { selector: { matchLabels: { app: string; }; }; replicas: number; template: { metadata: { labels: { ...; }; }; spec: { ...; }; }; }; }>'. Type '{ model: K8sModel; resource: { apiVersion: string; kind: string; metadata: { name: string; namespace: string; labels: { app: string; }; }; spec: { selector: { matchLabels: { app: string; }; }; replicas: number; template: { ...; }; }; }; }' is missing the following properties from type '{ model: K8sModel; resource: { apiVersion: string; kind: string; metadata: { name: string; namespace: string; labels: { app: string; }; }; spec: { selector: { matchLabels: { app: string; }; }; replicas: number; template: { ...; }; }; }; requestInit: RequestInit; json: Record<...>; }': requestInit, json
Raising severity as the types look incorrect in the SDK.
This bug has been verified on payload 4.11.0-0.nightly-2022-03-04-063157 Verification Steps: 1. Prepare(download) the newest code of console 2. Go to 'dynamic-demo-plugin' folder $ cd dynamic-demo-plugin 3. Execute below command, verified if it is able to build successfully $ yarn install $ yarn run build Result: 3. The dynamic-demo-plugin is built successfully without any error
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:5069