Implementing module federation using vite
can we do module federation using vite here, when i try im getting error like
Failed to fetch dynamically imported module: http://localhost:3001/node_modules/.vite/packages/twenty-front/deps/react.js?v=112902a4
8 Replies
Hello
What are you trying to do exactly
@prastoin I'm creating a micro front-end, for example, a chatbot using React and Vite, with the originjs/vite-plugin-federation package. However, I'm encountering an error when using React-based hooks in the chatbot. Just returning a simple <div> works fine.
Hello @Dev_A could you please share the error
Will need more information
Also we have not implemented module fédération so you will have more information nor clue than me
Please follow official module fede vite docs in order to setup it
Seems like you haven't react installed
@prastoin react is installed and checked in node_modules and package for the same
No clue what is happening
do I need to share my package or vite.config ?
Please refer to the module federation plugin you're using such as https://github.com/originjs/vite-plugin-federation
Sorry but I can't really help you:
- As we haven't implemented module federation ourselves
- I don't know what you've already done in order to integrate it to the vite build
I would be happy to help if I can
Maybe removing your node_modules and re-installing your deps could be a first step
Also might come from esm cjs import idk
ok