module-federation / core

Module Federation is a concept that allows developers to share code and resources across multiple JavaScript applications
https://module-federation.io/
MIT License
1.42k stars 212 forks source link

federation runtime vue 3 remotes with getPublicPath generates double calls (one with wrong public path) #2810

Open WeetA34 opened 1 month ago

WeetA34 commented 1 month ago

Describe the bug

Hello,

I use federation runtime to dynamically import vue 3 remotes with getPublicPath. some css, vendors assets are called twice:

you can see screenshots in the repro project README.

It doesn't always generate an issue as one of the two calls succeeds.

I don't have this behavior if I replace getPublicPath by a static publicPath.

Thank you

Reproduction

https://github.com/WeetA34/mf-double-calls-repro

Used Package Manager

yarn

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 128.44 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.1 - /usr/local/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn ---> yarn 4.3.1 with nodeLinker node-modules in the project
    npm: 9.8.1 - /opt/homebrew/bin/npm
    pnpm: 9.4.0 - /opt/homebrew/bin/pnpm
    bun: 1.0.21 - ~/.bun/bin/bun
  Browsers:
    Chrome: 126.0.6478.185
    Safari: 17.5

Validations

WeetA34 commented 1 month ago

Hello, fyi, it's still the same with 0.3.5

WeetA34 commented 1 month ago

Hello, fyi, it's still the same with 0.5.1

WeetA34 commented 1 week ago

Hello, fyi, it's still the same with 0.6.3 :)

TSMI235 commented 3 days ago

+1, seeing the same issue as well (with React, although that doesn't really matter here)