"Uncaught TypeError: Cannot read property 'bind' of undefined" while using module federation

Viewed 437

I am using module federation to import a module from a remote and getting the following error:

Uncaught TypeError: Cannot read property 'bind' of undefined
at bootstrap.js:10
at lazyInitializer (react.development.js:1275)
at mountLazyComponent (react-dom.development.js:17662)
at beginWork (react-dom.development.js:19055)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
at invokeGuardedCallback (react-dom.development.js:4056)
at beginWork$1 (react-dom.development.js:23964)
at performUnitOfWork (react-dom.development.js:22779)
at workLoopSync (react-dom.development.js:22707)

Update:

After hours of effort, I am able to identify the root cause of this error.

By changing the

'react': { singleton: true, requiredVersion: deps.react },

to

'react': { singleton: true },

the error is fixed. Looks like a webpack bug.

0 Answers
Related