Federated module is undefined ! ScriptExternalLoadError: Loading script failed #18195
Unanswered
knightswatch3
asked this question in
Q&A
Replies: 3 comments 4 replies
-
Is this an existing bug in the webpack v5 ? |
Beta Was this translation helpful? Give feedback.
4 replies
-
@knightswatch3 did you found any solution for this? I believe I am facing the same issue
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Firstly, I appreciate anyone taking time to look at this. And yes, this might look like a duplicate discussion.
Honestly, I've tried the solutions that worked for others in discussions but none of the fixes worked.
Issue :
a. Loaded remote module from app1 is undefined. I am unable to use any of the store methods app1 is exporting via remote module.
b. I have a similar issue with another app (not in the repo currently ) which exposes a react component called
<Auth/>
which when I import and use in the index.tsx of app2 I run intoI believe these two are inter-related and solving the first(a) will result in a fix for the other.
federated-module-issue
How to start ?
Clone the repo.
Ensure you have pnpm (8.14.1) and node(v20.11.1).
cd into app1 and run pnpm run-app1
cd into app2 and run pnpm run-app2
This will spin up both the apps.
App1 Serves the remote module on 5001 as configured:
But app1 finds the imported federated module as undefined. Which is confusing.
If I export a remote module which has a React components from *.tsx file I experience this issue:
Here is the link to the reproducible repo for the issue (a). Looking forward for some interactive discussion to understand and fix this issue.
What have I tried ? (and not worked)
1. Ensuring shared dependencies are valid.
2. Ensure the network port doesn't issue any errors for remote module imports.
3. Ensure that the remote module is actually serving the remoteEntry in the mentioned port(webpack config)
4. Passing library => var on the hosting side of the module to be available through the global scope of the app.
5. Passing the module as a promise from the remote object.
Beta Was this translation helpful? Give feedback.
All reactions