Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2019986

Summary: Dynamic demo plugin fails to build
Product: OpenShift Container Platform Reporter: Vojtech Szocs <vszocs>
Component: Management ConsoleAssignee: Vojtech Szocs <vszocs>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.9CC: aos-bugs, jhadvig, kdoberst, yapei
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:24:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vojtech Szocs 2021-11-03 18:57:05 UTC
Description of problem:

Dynamic demo plugin fails to build, steps to reproduce:

$ git clone https://github.com/openshift/console.git
$ cd console
$ ( cd frontend ; yarn install )
$ ( cd dynamic-demo-plugin ; yarn install && yarn build-dev )

Comment 2 Yadan Pei 2021-11-04 01:55:59 UTC
I can see following errors

ERROR in container entry K8sAPIConsumer[6]
Module not found: Error: Can't resolve './components/K8sConsumer/K8sAPIConsumer.tsx' in '/root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src'

ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx
[tsl] ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(13,10)
      TS2305: Module '"../../../node_modules/@openshift-console/dynamic-plugin-sdk/lib/lib-core"' has no exported member 'k8sCreate'.

ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx
[tsl] ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(13,21)
      TS2305: Module '"../../../node_modules/@openshift-console/dynamic-plugin-sdk/lib/lib-core"' has no exported member 'k8sDelete'.

ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx
[tsl] ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(13,32)
      TS2305: Module '"../../../node_modules/@openshift-console/dynamic-plugin-sdk/lib/lib-core"' has no exported member 'k8sGet'.

ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx
[tsl] ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(13,40)
      TS2305: Module '"../../../node_modules/@openshift-console/dynamic-plugin-sdk/lib/lib-core"' has no exported member 'k8sList'.

ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx
[tsl] ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(13,49)
      TS2305: Module '"../../../node_modules/@openshift-console/dynamic-plugin-sdk/lib/lib-core"' has no exported member 'k8sPatch'.

ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx
[tsl] ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/K8sAPIConsumer.tsx(13,78)
      TS2305: Module '"../../../node_modules/@openshift-console/dynamic-plugin-sdk/lib/lib-core"' has no exported member 'k8sUpdate'.

ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/k8s-data.ts
[tsl] ERROR in /root/odev/src/github.com/openshift/console/dynamic-demo-plugin/src/components/k8sConsumer/k8s-data.ts(1,10)
      TS2305: Module '"../../../node_modules/@openshift-console/dynamic-plugin-sdk/lib/api/common-types"' has no exported member 'K8sModel'.

ERROR in console-extensions.json (1 errors)
    Invalid module 'K8sAPIConsumer' in extensions[26] property 'component'

(node:2095) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:2095) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Comment 3 Jakub Hadvig 2021-11-04 12:28:14 UTC
Looks like the cause of this is in https://github.com/openshift/console/pull/10243

Comment 4 Vojtech Szocs 2021-11-04 17:52:02 UTC
Yadan, please see the associated PR. Applying it on top of latest Console master branch should fix the issue.

Comment 6 Yadan Pei 2021-11-08 06:33:30 UTC
1. pull latest console code 
2. cd frontend; yarn install
3. cd dynamic-demo-plugin ; yarn install && yarn run build )
[root@preserved-qe-ui-rhel-1 dynamic-demo-plugin]# yarn run build
yarn run v1.22.15
$ yarn clean && yarn generate && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 yarn ts-node ./node_modules/.bin/webpack --mode=production
$ rm -rf ./public/dist
$ yarn generate-graphql && yarn build-plugin-sdk
$ graphql-codegen --config graphql-codegen.yml
  ✔ Parse configuration
  ✔ Generate outputs
$ yarn --cwd packages/console-dynamic-plugin-sdk build
$ yarn clean && yarn validate && yarn compile && yarn generate
$ rm -rf dist generated
$ yarn ts-node scripts/validate-extensions.ts
$ ts-node -O '{"module":"commonjs"}' scripts/validate-extensions.ts
Validating Console extension types
Warnings (42)
    Extension type 'PVCCreateProp' has no JSDoc comments
    Extension type 'PVCStatus' has no JSDoc comments
    Extension type 'PVCAlert' has no JSDoc comments
    Extension type 'PVCDelete' has no JSDoc comments
    Extension type 'AddAction' has no JSDoc comments
    Extension type 'AddActionGroup' has no JSDoc comments
    Extension type 'ClusterGlobalConfig' has no JSDoc comments
    Extension type 'HrefNavItem' has no JSDoc comments
    Extension type 'ResourceNSNavItem' has no JSDoc comments
    Extension type 'ResourceClusterNavItem' has no JSDoc comments
    Extension type 'Separator' has no JSDoc comments
    Extension type 'NavSection' has no JSDoc comments
    Extension type 'FileUpload' has no JSDoc comments
    Extension type 'AlertAction' has no JSDoc comments
    Extension type 'AlertAction' property 'alert' has no JSDoc comments
    Extension type 'AlertAction' property 'text' has no JSDoc comments
    Extension type 'AlertAction' property 'action' has no JSDoc comments
    Extension type 'StorageProvider' has no JSDoc comments
    Extension type 'StorageProvider' property 'name' has no JSDoc comments
    Extension type 'StorageProvider' property 'Component' has no JSDoc comments
    Extension type 'TelemetryListener' has no JSDoc comments
    Extension type 'CatalogItemType' has no JSDoc comments
    Extension type 'CatalogItemProvider' has no JSDoc comments
    Extension type 'CatalogItemFilter' has no JSDoc comments
    Extension type 'PodAdapter' property 'adapt' has no JSDoc comments
    Extension type 'BuildAdapter' property 'adapt' has no JSDoc comments
    Extension type 'NetworkAdapter' property 'adapt' has no JSDoc comments
    Extension type 'TopologyDisplayFilters' property 'getTopologyFilters' has no JSDoc comments
    Extension type 'TopologyDisplayFilters' property 'applyDisplayOptions' has no JSDoc comments
    Extension type 'TopologyDecoratorProvider' property 'id' has no JSDoc comments
    Extension type 'TopologyDecoratorProvider' property 'priority' has no JSDoc comments
    Extension type 'TopologyDecoratorProvider' property 'quadrant' has no JSDoc comments
    Extension type 'TopologyDecoratorProvider' property 'decorator' has no JSDoc comments
    Extension type 'TopologyRelationshipProvider' property 'provides' has no JSDoc comments
    Extension type 'TopologyRelationshipProvider' property 'tooltip' has no JSDoc comments
    Extension type 'TopologyRelationshipProvider' property 'create' has no JSDoc comments
    Extension type 'TopologyRelationshipProvider' property 'priority' has no JSDoc comments
    Extension type 'CreateResource' has no JSDoc comments
    Extension type 'UserPreferenceGroup' has no JSDoc comments
    Extension type 'UserPreferenceItem' has no JSDoc comments
    Extension type 'Perspective' has no JSDoc comments
    Extension type 'HorizontalNavTab' has no JSDoc comments
$ for ext in '' '-internal' '-internal-kubevirt' '-webpack' ; do yarn tsc -p tsconfig${ext}.json ; done
$ /root/odev/src/github.com/openshift/console/frontend/node_modules/.bin/tsc -p tsconfig.json
$ /root/odev/src/github.com/openshift/console/frontend/node_modules/.bin/tsc -p tsconfig-internal.json
$ /root/odev/src/github.com/openshift/console/frontend/node_modules/.bin/tsc -p tsconfig-internal-kubevirt.json
$ /root/odev/src/github.com/openshift/console/frontend/node_modules/.bin/tsc -p tsconfig-webpack.json
$ yarn generate-schema && yarn generate-doc && yarn generate-pkg-assets
$ yarn ts-node scripts/generate-schema.ts
$ ts-node -O '{"module":"commonjs"}' scripts/generate-schema.ts
Generating Console plugin JSON schemas
generated/schema/plugin-package.json
generated/schema/plugin-package.cjs
generated/schema/console-extensions.json
generated/schema/console-extensions.cjs
generated/schema/plugin-manifest.json
generated/schema/plugin-manifest.cjs
$ yarn ts-node scripts/generate-doc.ts
$ ts-node -O '{"module":"commonjs"}' scripts/generate-doc.ts
Generating Console plugin documentation
generated/doc/console-extensions.md
$ yarn ts-node scripts/generate-pkg-assets.ts
$ ts-node -O '{"module":"commonjs"}' scripts/generate-pkg-assets.ts
Generating assets for package @openshift-console/dynamic-plugin-sdk
dist/core/package.json
dist/core/LICENSE
dist/core/README.md
dist/core/doc
Generating assets for package @openshift-console/dynamic-plugin-sdk-internal
dist/internal/package.json
dist/internal/LICENSE
dist/internal/README.md
Generating assets for package @openshift-console/dynamic-plugin-sdk-internal-kubevirt
dist/internal-kubevirt/package.json
dist/internal-kubevirt/LICENSE
dist/internal-kubevirt/README.md
Generating assets for package @openshift-console/dynamic-plugin-sdk-webpack
dist/webpack/package.json
dist/webpack/LICENSE
dist/webpack/README.md
dist/webpack/schema
$ ts-node -O '{"module":"commonjs"}' ./node_modules/.bin/webpack --mode=production
Starting type checking service...
Done in 505.09s.

no errors

Comment 10 errata-xmlrpc 2022-03-10 16:24:56 UTC
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 (Moderate: OpenShift Container Platform 4.10.3 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:0056