Closed phantomjinx closed 6 months ago
@tadayosi Would appreciate your thoughts on this...
Initially, thought it must be the dependency upgrades I merged in, yesterday, but taking out a branch and going back to prior to the upgrades, these errors pop up the moment that I upgrade @hawtio/react
to version 1.0.4
.
I have some kind of fix / workaround for the react-charts
error:
victory-...
dependencies, eg. victory-core
.
36.9.1
to node-modules
36.8.6
to `node-modules/@patternfly/react-charts/node-modules/victory-core36.9.1
so when consuming react-charts
as a 3rd-party dependency in hawtio-online, it tries to consume 36.9.1
and the API has obviously changed between the two versions, generating the first error.package.json
(obviously not an ideal solution):
"@patternfly/react-charts": "6.94.21",
"victory-area": "36.8.6",
"victory-axis": "36.8.6",
"victory-bar": "36.8.6",
"victory-chart": "36.8.6",
"victory-core": "36.8.6",
"victory-create-container": "36.8.6",
"victory-cursor-container": "36.8.6",
"victory-group": "36.8.6",
"victory-legend": "36.8.6",
"victory-line": "36.8.6",
"victory-pie": "36.8.6",
"victory-scatter": "36.8.6",
"victory-stack": "36.8.6",
"victory-tooltip": "36.8.6",
"victory-voronoi-container": "36.8.6",
"victory-zoom-container": "36.8.6",
The second error is more of a problem and frankly I am stumped. It appears that the upgrade of @module-federation/utilties
from 3.0.0
(or possibly 3.0.2
as it is mentioned in yarn.lock
) to 3.0.5
has introduced a dynamic loading at line (node_modules/@hawtio/react/node_modules/@module-federation/utilities/dist/index.cjs.js 862:122-132) which webpack just does not like:
(function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(/ * webpackIgnore: true */ url)
Have tried a couple of things like defining the mf/utilities version in hawtio-online and trying to ignore the library in the webpack config but nothing has worked. So am just not sure how to proceed with this so please any suggestions would appreciated.
Yeah they are all known issues.
For react-charts
, it's the issue with react-charts
where it only specifies ^36.6.7
as the victory-core
version, so the semver by yarn tries to upgrade it to the latest one 36.9.x
which has some breaking changes. So the solution is easy, you can just set resolution of victory-core
to 36.8.6
by running the yarn command:
yarn set resolution victory-core@npm:^36.6.7 npm:36.8.6
Note only victory-core
needs to be fixed. The other victory libs are fine to upgrade to latest.
Next, for the MF utilities, it's actually just a warning, so you can ignore it when running locally.
WARNING in ../../node_modules/@hawtio/react/node_modules/@module-federation/utilities/dist/index.cjs.js 862:122-132
Critical dependency: the request of a dependency is an expression
However, with CI=true
a warning causes the CI to stop. So, to fix it, you can simply force ignoring it. You can check how hawtio/hawtio handles the exact issue:
https://github.com/hawtio/hawtio/commit/aa29d5eb5d6f479ffb5183bb8d66c2c221e0d14b
Note the latest @hawtio/react
is 1.0.6, and I'll soon release 1.0.7 which contains fixes requested from the Artemis team. So please upgrade it to the latest.
1.0.7 released: https://github.com/hawtio/hawtio-next/releases/tag/v1.0.7
PR for 1.0.7 -> https://github.com/hawtio/hawtio-online/pull/347
After upgrade to 1.0.4 (or 1.0.5 or 1.0.6), these errors are presented when starting the dev-server.