originjs / vite-plugin-federation

Module Federation for vite & rollup
Other
2.39k stars 241 forks source link

Issue with Chrome #630

Closed tathje closed 4 weeks ago

tathje commented 2 months ago

Versions

Steps to reproduce

What is actually happening?

AlexThurston commented 2 months ago

I can confirm that this is happening on other Chromium based browsers like Arc and Brave, but things are working correctly on Safari.

There doesn't appear to be any logs or errors in the browser dev console either.

I did notice that the div ends up empty in the browsers that don't work.

image

AlexThurston commented 2 months ago

Related to https://github.com/antfu/repro-chrome-v129 perhaps?

n-anilrathod commented 1 month ago

We are encountering the same issue on both Chrome and Edge after the latest version 129 update. Applications in production that rely on the vite-plugin-federation plugin have gone down completely. Could the Vite-plugin-federation team kindly look into this as a priority and provide a quick fix?

ahatton-hpt commented 1 month ago

@n-anilrathod

Related to https://github.com/antfu/repro-chrome-v129 perhaps?

I believe @AlexThurston is correct. After investigating, this issue only seems to occur when HMR is enabled. Disabling HMR in development resolves the issue, but at the cost of losing Hot Reload functionality. It appears that this Chrome bug is fixed in the upcoming v130 release. I tested the beta version of Chrome with HMR enabled, and it worked without issues.

I have not encountered any problems with production builds or deployments—this only happens for me during development when Vite is running as a server with HMR enabled.

SkyWalker653 commented 1 month ago

I am using vite-plugin-top-level-await plugin as a temporary workaround.

n-anilrathod commented 1 month ago

@n-anilrathod

Related to https://github.com/antfu/repro-chrome-v129 perhaps?

I believe @AlexThurston is correct. After investigating, this issue only seems to occur when HMR is enabled. Disabling HMR in development resolves the issue, but at the cost of losing Hot Reload functionality. It appears that this Chrome bug is fixed in the upcoming v130 release. I tested the beta version of Chrome with HMR enabled, and it worked without issues.

I have not encountered any problems with production builds or deployments—this only happens for me during development when Vite is running as a server with HMR enabled.

@ahatton-hpt, the issue was not related to HMR as initially thought. It appears to be linked to circular imports, similar to what's described here: https://github.com/antfu/repro-chrome-v129. To resolve the issue, I added the vite-plugin-top-level-await, which seems to fix it. However, this plugin is considered optional for the latest Chrome versions. While the issue is temporarily resolved, I hope we won't encounter similar problems in the future.

tathje commented 4 weeks ago

This issue has been resolved on chrome 130.