Skip to content

Webpack Module Federation Support #140

@hezi-bigpanda

Description

@hezi-bigpanda

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: webpack/webpack#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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions