naughtLdy / sandbox-module-federation

1 stars 0 forks source link

cannot convert object to primitive value #1

Open adirzoari opened 9 months ago

adirzoari commented 9 months ago

Hi, I set up a host project using React, TypeScript, and Webpack and set up a remote project using Vite. then I configure module federation between the host and remote projects like you did, but I got ERROR Cannot convert object to primitive value TypeError: Cannot convert object to primitive value at mountLazyComponent (http://localhost:3000/vendors-node_modules_react-dom_index_js.1708797346222.chunk.js:17372:88) at beginWork (http://localhost:3000/vendors-node_modules_react-dom_index_js.1708797346222.chunk.js:18722:20) at HTMLUnknownElement.callCallback (http://localhost:3000/vendors-node_modules_react-dom_index_js.1708797346222.chunk.js:3733:18) at Object.invokeGuardedCallbackDev (.....

this is my full issue: https://github.com/originjs/vite-plugin-federation/issues/576

can you please check or can i contact with you?

naughtLdy commented 6 months ago

@adirzoari Sorry, I don't know why your environment does not work. It may not work correctly with the combination of vite and webpack.

https://github.com/originjs/vite-plugin-federation?tab=readme-ov-file#integration-with-webpack

  1. It is not recommended to mix Vite and Webpack in React projects, as there is no guarantee that Vite/Rollup and Webpack will generate the same chunk when packaging commonjs, which may cause problems with shared.