Bug 2019986 - Dynamic demo plugin fails to build
Summary: Dynamic demo plugin fails to build
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.10.0
Assignee: Vojtech Szocs
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-03 18:57 UTC by Vojtech Szocs
Modified: 2022-03-10 16:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-10 16:24:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 10395 0 None open Bug 2019986: Fix dynamic demo plugin build 2021-11-04 17:50:21 UTC
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-10 16:25:11 UTC

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


Note You need to log in before you can comment on or make changes to this bug.