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

Duplicate assetsDir in __federation_expose_ #657

Open
tathje opened this issue Jan 2, 2025 · 6 comments
Open

Duplicate assetsDir in __federation_expose_ #657

tathje opened this issue Jan 2, 2025 · 6 comments

Comments

@tathje
Copy link

tathje commented Jan 2, 2025

Versions

  • vite-plugin-federation: ^1.3.7 (latest)
  • vite: ^5.46

Details

  • using build.assetsDir in vite.config.ts. For example: remote/assets

What is actually happening?

  • Duplicate assetsDir in __federation_expose script. Eg: /remote/assets/remote/assets/__federation_expose_*.js
  • Expect: /remote/assets/__federation_expose_*.js
  • I think the problem may originate from here
@JayeshBaviskar07
Copy link

I am too facing the same issue

@Smartauto
Copy link

Hi There
We are also getting same Issue.
https://domain.com/forms/**assets/assets**/__federation_expose_App-c1fd8uuuaf7.js

We are using vite 4.5.2

@Sayeedweecover
Copy link

im facing same issue as well

@riyaddecoder
Copy link

We are facing this issue too.

@Smartauto
Copy link

We have Fixed this issue by Specifying the Build options in vite.config.js
build: {
modulePreload: false,
target: "esnext",
minify: false,
cssCodeSplit: false,
rollupOptions: {
output: {
assetFileNames: "[name]-[hash][extname]",
chunkFileNames: "[name]-[hash].js",
entryFileNames: "[name].js",
},
},
assetsDir: "",
},

The Root cause was Vite is using Bable internally.
Bable and its other components current release is 7.26. we were using 7.23 and the build was getting made correctly.
Build was getting made correctly till we package-lock.json was not deleted. Post deletion the Bable packages got updated and build started making duplicate folder for assets.

Hope this helps.

@FalcoO0n
Copy link

FalcoO0n commented Jan 6, 2025

@Smartauto Thanks a lot. Its Working for Us now

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

6 participants