Describe the bug
The GitOps Applications page shows nothing when opened.
The following JS error appears in the browser's debug console (F12):
coderef-resolver.ts:77 Failed to load module 'ApplicationList' of plugin gitops-plugin@0.0.17
Error: Shared module @patternfly/react-topology doesn't exist in shared scope default
at m (consumes:64:8)
at consumes:67:9
at u (consumes:81:33)
at consumes:107:34
at consumes:77:9
at 50492 (consumes:139:16)
at consumes:397:42
at Array.forEach (<anonymous>)
at T.f.consumes (consumes:378:25)
at ensure chunk:6:25
Additionally, opening the "Applications" tab from an ApplicationSet's detail page throws a different JS error:
Cannot access 'X' before initialization
at exposed-ApplicationSetDetailsPage-chunk-...
To Reproduce
- Install OpenShift GitOps Operator on an OCP 4.16 cluster.
- Go to the OpenShift web console.
- Navigate to the GitOps → Applications page.
- See nothing rendered, and the error above in the browser console.
Expected behavior
The Applications page should list the Argo CD Applications in the cluster.
Screenshots
Additional context
The following is speculation, but ApplicationList.tsx (in redhat-developer/gitops-console-plugin) statically imports ApplicationSetGraphView, a component that depends on @patternfly/react-topology. That component is only actually rendered when the appset prop is passed. However, ApplicationList is also registered as the standalone Applications list page, where appset is always undefined.
A static import is evaluated at module-load time regardless of whether the component is actually rendered, so simply opening the standalone list page requires resolving @patternfly/react-topology. The stack trace above (consumes.js, webpack Module Federation's shared-module resolution logic) shows this resolution failing.
I also found that @patternfly/react-topology appears to have become a "Console-provided shared singleton module" only as of OpenShift Console 4.18. gitops-plugin is built against @openshift-console/dynamic-plugin-sdk ^4.19.1, which relies on that assumption (that the Console provides it). My environment is OCP 4.16, so this shared module doesn't exist on the Console side, which I believe is causing the error above.
Since OpenShift GitOps Operator 1.21 officially lists OCP 4.16 as a supported version, if my speculation above is correct, there may be a gap between the officially supported version and the actual build assumptions of the plugin.
Environment
- Red Hat OpenShift on IBM Cloud: 4.16.63
- OpenShift GitOps: 1.21.1
Describe the bug
The GitOps Applications page shows nothing when opened.
The following JS error appears in the browser's debug console (F12):
Additionally, opening the "Applications" tab from an ApplicationSet's detail page throws a different JS error:
To Reproduce
Expected behavior
The Applications page should list the Argo CD Applications in the cluster.
Screenshots
Additional context
The following is speculation, but ApplicationList.tsx (in redhat-developer/gitops-console-plugin) statically imports ApplicationSetGraphView, a component that depends on @patternfly/react-topology. That component is only actually rendered when the appset prop is passed. However, ApplicationList is also registered as the standalone Applications list page, where appset is always undefined.
A static import is evaluated at module-load time regardless of whether the component is actually rendered, so simply opening the standalone list page requires resolving @patternfly/react-topology. The stack trace above (consumes.js, webpack Module Federation's shared-module resolution logic) shows this resolution failing.
I also found that @patternfly/react-topology appears to have become a "Console-provided shared singleton module" only as of OpenShift Console 4.18. gitops-plugin is built against @openshift-console/dynamic-plugin-sdk ^4.19.1, which relies on that assumption (that the Console provides it). My environment is OCP 4.16, so this shared module doesn't exist on the Console side, which I believe is causing the error above.
Since OpenShift GitOps Operator 1.21 officially lists OCP 4.16 as a supported version, if my speculation above is correct, there may be a gap between the officially supported version and the actual build assumptions of the plugin.
Environment