patternfly / react-topology

MIT License
13 stars 20 forks source link

OCP has errors thrown due to dagrejs dep #225

Closed thatblindgeye closed 2 months ago

thatblindgeye commented 5 months ago

Describe the problem From findings in https://github.com/patternfly/patternfly-react/issues/10403. When building OCP using prerelease numbers, and either a) not updating the Charts version or b) using resolutions for Victory dep + updating charts version, there are errors thrown due to the dagrejs dep in Topology:

ERROR in ./node_modules/@dagrejs/graphlib/lib/data/priority-queue.js 9:7
Module parse failed: Unexpected token (9:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|  */
| class PriorityQueue {
>   _arr = [];
|   _keyIndices = {};
| 
ERROR in packages/knative-plugin/src/topology/listView/knativeListViewComponentFactory.ts:34:7

How do you reproduce the problem? Provide steps to reproduce. A codesandbox demonstrating the problem is appreciated.

Expected behavior A clear and concise description of the expected behavior.

Is this issue blocking you? List the workaround if there is one.

Screenshots If applicable, add screenshots to help explain the issue.

What is your environment?

What is your product and what release date are you targeting?

Any other information?

jeff-phillips-18 commented 5 months ago

@thatblindgeye Which releases are you using?

thatblindgeye commented 5 months ago

From my latest testing, these are the PatternFly releases I used:

"@patternfly/patternfly": "5.4.0-prerelease.5",
"@patternfly/quickstarts": "5.3.0",
"@patternfly/react-catalog-view-extension": "5.0.0",
"@patternfly/react-charts": "7.4.0-prerelease.12",
"@patternfly/react-component-groups": "5.3.0-prerelease.1",
"@patternfly/react-console": "5.0.0",
"@patternfly/react-core": "^5.4.0-prerelease.16",
"@patternfly/react-icons": "^5.4.0-prerelease.6",
"@patternfly/react-log-viewer": "5.2.0",
"@patternfly/react-styles": "^5.4.0-prerelease.7",
"@patternfly/react-table": "^5.4.0-prerelease.17",
"@patternfly/react-tokens": "^5.4.0-prerelease.6",
"@patternfly/react-topology": "5.4.0-prerelease.10",
"@patternfly/react-user-feedback": "5.0.0",
"@patternfly/react-virtualized-extension": "5.1.0",

The only difference is that the @patternfly/react-charts was either using the prelease version mentioned above + resolutions for Victory deps to use their 36.9.1 release, or using the 7.2.2 release of @patternfly/react-charts without Victory resolutions.

jenny-s51 commented 4 months ago

@jeff-phillips-18 and I tested the build this afternoon in OCP using these versions and were able to reproduce these dagre errors. This issue typically arises on the product side in webpack configurations when webpack encounters a file type that it doesn't know how to process by default.

In order to fix this, OCP may have to change their webpackconfig or tsconfig settings. cc @thatblindgeye