react2angular icon indicating copy to clipboard operation
react2angular copied to clipboard

Webpack Module Federation Support

Open hezi-bigpanda opened this issue 3 years ago • 0 comments

Hi, I am using today react2angular in my angularjs application in order to adapt react components

I want to extract these components to another application, however, it causes an error when I declare react as a shared service in webpack module federation plugin https://webpack.js.org/concepts/module-federation/#uncaught-error-shared-module-is-not-available-for-eager-consumption.

For more information see this discussion in webpack github: https://github.com/webpack/webpack/discussions/15237:

Uncaught Error: Shared module is not available for eager consumption: webpack/sharing/consume/default/react/react at Object.webpack_require.m. (consumes:144) at webpack_require (bootstrap:24) at fn (hot module replacement:61) at Object../node_modules/react2angular/index.js (index.js:23) at webpack_require (bootstrap:24) at fn (hot module replacement:61) at ......

Is there a way to work it around, in general, the solution should be dynamically import the render code like in the docs, but I have no control on the rendering

Any advise ?

hezi-bigpanda avatar Jan 24 '22 15:01 hezi-bigpanda