originjs / vite-plugin-federation

Module Federation for vite & rollup
Other
2.39k stars 241 forks source link

Rollup failed to resolve import "__federation_fn_satisfy" from "virtual:__federation_fn_import #549

Open mannymu opened 11 months ago

mannymu commented 11 months ago

Versions

Reproduction

This error occurs in the server build of vue SSR

Steps to reproduce

What is Expected?

What is actually happening?

JessYan0913 commented 11 months ago

ๅŒ้—ฎ

Issues-translate-bot commented 11 months ago

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


The same question

JessYan0913 commented 11 months ago

image Why did I fail to introduce 'virtual:federation' and the console prompt: virtual:__federation__ does not exist

image

MarishKo commented 11 months ago

The same question. Any ideas?

AttackXiaoJinJin commented 11 months ago

same๏ผŒplease fix it

image
AntonyF-Andreani commented 11 months ago

In m case the only way is to put in ignore of optimization, other wa is set as external because this function is virtual and injected b plugin.

I use this because I'm use import {} from "federation"

optimizeDeps: {
        exclude: ["__federation__"],
      },
SrikanthVH commented 10 months ago

Looks like there is some problem with the shared modules. I commented outshared attribute, its working.

federation({
              name: 'host-app',
              remotes: {
                  svelte_remote_app: "http://localhost:3999/assets/remoteEntry.js",//"http://localhost:5173/assets/remoteEntry.js",
                  react_remote_app: "http://localhost:3998/assets/remoteEntry.js"//"http://localhost:5173/assets/remoteEntry.js",
              },
              //shared: ['svelte',"react","react-dom"]   <- Commented
            }),
Kronenberg commented 6 months ago

Same issue for me, I am using Remix.js framework which is SSR with latest versions of react and "vite": "^5.1.0"; and if I am using shared: ["react", "react-dom"] it doesn't work for me and I am getting same error as others.

anajnas66 commented 4 months ago

@Kronenberg Were you able to get it working with Remix apps? I'm facing this issue. [vite] Internal server error: The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '\x00virtual:/__federation__'. I already commented out the code under the "shared" section in both the host/remote apps.

veeramarni commented 1 month ago

I have the same issue. Any fix for the above issue?