-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Remix and Vite apps using Federation #609
Comments
Turns out I was running my app in dev mode. On running in prod mode using the serve command, I now see a different error while building my host app. Error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'http:' |
@anajnas66, Sorry. Have you already resolved this? I'm thinking of setting up a project with remix-spa and module federation. |
@anajnas66 @infantito did this got resolved for you? |
I'm using the React Router v6 API because remix-run was ruled out by my team. React Router V6 works well with module federation; it probably would work with Remix SPA. |
Hello, good I came across this thread, I'm in the same boat - started building a fleet of frontends (not going to call them micro as they're really only sections) thinking module federation can't be that hard with Remix (given it's one of the recommendations in the React docs and the newer shinier option). Unfortunately it seems to me it's an unresolved problem so far. Any pointers are welcome. Thanks! |
@marono/all anyone tried on remix with SSR successfully? |
Same. https://github.com/lucax88x/microfrontend-poc/tree/main/shells/shell-remix but I have a different error Error: require is not defined |
I noticed an example in the module federation example repo: https://github.com/module-federation/module-federation-examples/tree/master/rspack-remix I'm not sure if they are working |
Hey! I also had same issue saying But this only happened on host app and in remote it works well but unfortunately css styling didn't applied while build and serve Any comments are appreciated. Update: I found that the above error occurs because of the federation plugin we use and for the remote and it points out that http which we used on below remotes: {
remoteApp: "http://localhost:3000/assets/remoteEntry.js",
}, |
Versions
Reproduction
[vite] Error when evaluating SSR module virtual:remix/server-build:
|- TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '\x00virtual:<path_to_my_app>/__federation__'
Additional Details
Host vite config file -
Remote's vite.config file -
NOTE: The bundled file is accessible at http://localhost:3000/assets/remoteEntry.js
Steps to reproduce
What is Expected?
The host app should be able to access the Button component exposed from the remote app and render properly.
What is actually happening?
The remote app builds successfully while the host app throws the error while running "npm run build"
[vite] Error when evaluating SSR module virtual:remix/server-build:
|- TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '\x00virtual:<path_to_my_app>/federation'
The text was updated successfully, but these errors were encountered: