Skip to content
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

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

Open
5 tasks done
WeetA34 opened this issue Jul 30, 2024 · 10 comments
Assignees

Comments

@WeetA34
Copy link

WeetA34 commented Jul 30, 2024

Describe the bug

Hello,

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

  • once with the proper public path retrieved through the getPublicPath function
  • once with the consumer url which returns in my case the root html.

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
Copy link
Author

WeetA34 commented Aug 9, 2024

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

@WeetA34
Copy link
Author

WeetA34 commented Aug 21, 2024

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

@WeetA34
Copy link
Author

WeetA34 commented Sep 13, 2024

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

@TSMI235
Copy link

TSMI235 commented Sep 18, 2024

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

@WeetA34
Copy link
Author

WeetA34 commented Oct 2, 2024

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

@ScriptedAlchemy
Copy link
Member

hmm seems like a legit issue. Will check the source code.
You can try setting public path to auto?

@ScriptedAlchemy ScriptedAlchemy self-assigned this Oct 10, 2024
@WeetA34
Copy link
Author

WeetA34 commented Oct 12, 2024

Hello Zack,
i'll test that.
thx

@WeetA34
Copy link
Author

WeetA34 commented Oct 17, 2024

Hello Zack,
It seems to be ok without getPublicPath and config.output.publicPath set to 'auto' instead.
Thank you

@WeetA34
Copy link
Author

WeetA34 commented Oct 17, 2024

Hello again,
I moved to @module-federation/rsbuild-plugin.
publicPath='auto' by default
It works fine

@ScriptedAlchemy
Copy link
Member

Perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants