originjs / vite-plugin-federation

Module Federation for vite & rollup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

【example demo bug】Did not work as expected when using the sample demo

zhaoky opened this issue · comments

Steps to reproduce

  1. Pull the code from the main branch and install the dependency.
  2. Run the vue3-demo-esm example.
  3. The project started successfully, but some components did not load as expected.
image

Components in the red box are not rendered

What is Expected?

All components render normally.

What is actually happening?

Some components are not rendered.

image

Whether the remote component's module is asynchronously fetched, causing the ‘default‘ to be undefined?

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


It's because of shards. Button and Content use pinia. Requesting pinai is a promise, and the first accessed component defalut will be undefind.

It's because of shards. Button and Content use pinia. Requesting pinai is a promise, and the first accessed component defalut will be undefind.

const dynamicComponents = ['Button','Images','Content'];

If the Content is placed after the Button, the Button will be undefined.
Although I have found the problem, I still don't know how to configure it. I am still researching. Have you taken care of it?