vite-plugin-federation icon indicating copy to clipboard operation
vite-plugin-federation copied to clipboard

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

Open zhaoky opened this issue 1 year ago • 3 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?

zhaoky avatar Feb 29 '24 12:02 zhaoky

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.

Issues-translate-bot avatar May 06 '24 07:05 Issues-translate-bot

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

xplloveyxl avatar May 06 '24 07:05 xplloveyxl

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?

xplloveyxl avatar May 06 '24 07:05 xplloveyxl