Comments (8)
@zgid123 here is a demo about antd/message/notification
+ vite-federation
setup can reproduce the issue
however, if we also use antd/message/notification
in the host, antd/message/notification
in remote app will also work
from vite-plugin-federation.
I will have a look later, currently, I am having problem with chakra-ui and this package new version. Don't know the reason yet. I will help the author to have a look at your issue after I solved my issue
from vite-plugin-federation.
@Volene
If possible, please provide a project to help us quickly locate whether the problem is from the configuration or something else.
from vite-plugin-federation.
Shared module cause this error but i dont know how to fix it
from vite-plugin-federation.
I also faced this problem when testing shared packages for chakra-ui.
Here my demo repository: https://github.com/zgid123/vite-module-federation-demo.
Please uncomment those packages in vite.config.ts
of monoApp folder
// '@emotion/react': '*',
// '@emotion/styled': '*',
// 'framer-motion': '*',
I don't know if sharing those packages can solve other problem or not, but when I tested antd
, I can fix that problem
from vite-plugin-federation.
I changed the code to skip add dep when the orderByDepCount[i]
is undefined
for (let i = 0; i < orderByDepCount.length; i++) {
if (i === 0) {
for (const key of orderByDepCount[i].keys()) {
priority.push(key)
}
} else {
for (const entries of orderByDepCount[i].entries()) {
addDep(entries, priority, depInShared)
}
}
}
I can build now but still receive the error
__federation_shared_react-dom.js:21 Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at p (__federation_shared_react.js:12)
at Object.o.useMemo (__federation_shared_react.js:12)
at react.js:292
at di (__federation_shared_react-dom.js:19)
at es (__federation_shared_react-dom.js:19)
at Ds (__federation_shared_react-dom.js:23)
at zs (__federation_shared_react-dom.js:23)
at kf (__federation_shared_react-dom.js:23)
at Dt (__federation_shared_react-dom.js:23)
at ji (__federation_shared_react-dom.js:21)
__federation_shared_react-dom.js:8 Uncaught Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at p (__federation_shared_react.js:12)
at Object.o.useMemo (__federation_shared_react.js:12)
at react.js:292
at di (__federation_shared_react-dom.js:19)
at es (__federation_shared_react-dom.js:19)
at Ds (__federation_shared_react-dom.js:23)
at zs (__federation_shared_react-dom.js:23)
at kf (__federation_shared_react-dom.js:23)
at Dt (__federation_shared_react-dom.js:23)
at ji (__federation_shared_react-dom.js:21)
If you had faced this error before, please help me to fix this. Only occur with chakra-ui
, I tested with antd
, there is no problem. I am trying to fix this, but still no luck.
from vite-plugin-federation.
hi @zgid123 , I have a problem with antd notification component (https://ant.design/components/notification/), this component works fine on my remote app on development mode, but when i build in production mode (host and mono app), it gives an error as below.
I suspect there is an import problem. Following is my vite config and package.json. Do i need to make my antd as shared dependencies? Appreciate, if you could let me know what is the problem. Thanks.
from vite-plugin-federation.
@nielsonlien can you provide a sample project? Because I only tested antd
to make sure if it worked. I don't use antd
for my side project
from vite-plugin-federation.
Related Issues (20)
- ERROR: Expression Expected - Unable to understand this error
- Mutliple WS connections established to the remote app
- Adding and then removing `manualChunks` causes runtime error
- flattenModule breaks dependencies HOT 1
- exporting variables from the shared module, the variables within the shared module appear as undefined HOT 1
- module federation react typescript webpack and vite throws an error "Loading script failed." HOT 2
- Vue2.7, Vite host with webpack remote, "shared" create undefiend paramter(with Reproduction project)
- 【example demo bug】Did not work as expected when using the sample demo HOT 3
- 【bug】vue3-demo-esm-shared-store running __federation_shared_myStore-ed6e87a0.js 404
- Module Federation + base url HOT 3
- Vite Module Federation CORS error HOT 4
- Do something like @module-federation/typescript? HOT 2
- Error: Minified React error #321; HOT 5
- Enable CORS by including credentials when fetching Remotes on other Domains
- Uncaught (in promise) TypeError: Failed to construct 'URL': Invalid URL HOT 2
- Shared dependencies is loaded sequentially
- React module federation gives __federation_shared_react-dom-6fc2ee8d.js:224 TypeError: Cannot read properties of null (reading 'useContext') at react_production_min.useContext (__federation_shared_react-af90d75c.js:59:144) HOT 6
- [MaterialUI] Cannot read properties of null (reading 'useContext')
- Is this project abandonned HOT 8
- Error accessing remoteEntry.js files throughout vite examples HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-plugin-federation.