Skip to content

Shared configuration is not supported when dynamic load remote module ?? #537

@yellowbeee

Description

@yellowbeee

webpack.config.js

shared: {
          react: {eager: true, singleton: true, requiredVersion: '^16.13.1'},
          'react-dom': {
            eager: true,
            singleton: true,
            requiredVersion: '^16.13.1',
          },
          'react-router-dom': {requiredVersion: '^5.1.2'},
          'mobx-react-lite': {requiredVersion: '^1.5.2'},
          mobx: {requiredVersion: '^5.15.4'},
          axios: {requiredVersion: '^0.19.2'},
 }

when i dynamic loading remote module, it throw error:

image

Then i find the error is the 'factory' is not a function, it return a Promise

image

and then i find the step of register shared module, it use 'webpack_require.e', not use 'webpack_require', it will return a Promise

image

How can I solve this problem ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions