-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
A few issues with Modern.js ssr #4298
Comments
hey , for the question 1 , i can not reproduce the error in my local while executing |
For the question 2 , it also works on my PC , but i'm not sure whether the monorepo has wrong configuration , so i split the examples , you can try this repo |
For the question 3 , it's a bug , i will fix it module-federation/core#3139 |
For the question 4 , this need you add cors header in browser currently . And i will add one debug plugin for this case |
For the question 5 , because i add devServer.headers in modernjs plugin , so it can work normally in dev mode . But this configuration can not work for For workaround, you can use serve package by executing |
For question 6, it should be fixed in a preview version , i will release it next week |
Because in byte , we don't use |
@2heal1 thank you for explanations. Can you describe what is the best way for serving SSR production apps (host and providers) with module federation plugin enabled. |
Running the Modern.js SSR example in dev mode works great. But building the
host
app fails withCannot find module 'remote/Image' or its corresponding type declarations.
, which can be fixed by casting the module name toany
:Is there a better way to fix it?
How does one get type hinting to work? If I add a prop to the Image component in the
provider
and try using it in thehost
app on the imported<RemoteSSRComponent />
, I get a type error.Even though TypeScript doesn't recognize the prop, it does work and is passed to the remote Image component. However, every time I change the prop from the host -- e.g. a counter increment -- I see the page flash for a split second with "Loading..." shown in place of both components before they show up again. How do I prevent this from happening?
Screen.Recording.2024-10-27.at.10.58.45.PM.mov
Running all three apps in dev mode works just fine, but when previewing the production build locally with
npm run serve
thehost
fails with a CORS error:Do you know how to fix this one? I struggled to find anything online and in Modern.js docs.
When serving, navigating to
http://localhost:3007/mf-manifest.json
andhttp://localhost:3008/mf-manifest.json
shows a blank page with only404
text in it. Is this normal? It doesn't happen when running in dev mode.When running in dev mode, I sometimes see the following
host
app console errors:I haven't been able to consistently reproduce it. Do you know what might be causing them?
The text was updated successfully, but these errors were encountered: