originjs / vite-plugin-federation

Module Federation for vite & rollup
Other
2.4k stars 242 forks source link

Chrome & Edge latest update broken Vue based applications on production. #633

Open n-anilrathod opened 2 months ago

n-anilrathod commented 2 months ago

Versions

Reproduction

What is actually happening?

Vite + Quasar app with vite-federation-plugin is not working in production mode (vite preview)

SkyWalker653 commented 2 months ago

Here's how I resolved the issue for me:

  1. Integrated the plugin vite-plugin-top-level-await.
  2. Set the build target to browser: ['es2022'] in the quasar.config.js file.
  3. (Optional) If the issue persists, add the following code to your package.json file:

    "overrides": {
     "vite": "^4.0.0",
     "@vitejs/plugin-vue": "^4.0.0"
    }
azieh commented 2 months ago

Hi, The same issue happened on my end. Because of the many distributed installations and applications, we have a big problem. We started receiving the next complaints with our apps after the Chromium update. All works on older browser versions.

azieh commented 2 months ago

Here's how I resolved the issue for me:

  1. Integrated the plugin vite-plugin-top-level-await.
  2. Set the build target to browser: ['es2022'] in the quasar.config.js file.
  3. (Optional) If the issue persists, add the following code to your package.json file:
    "overrides": {
     "vite": "^4.0.0",
     "@vitejs/plugin-vue": "^4.0.0"
    }

This solution works for me. Thank you for your help.

n-anilrathod commented 2 months ago

Here's how I resolved the issue for me:

  1. Integrated the plugin vite-plugin-top-level-await.
  2. Set the build target to browser: ['es2022'] in the quasar.config.js file.
  3. (Optional) If the issue persists, add the following code to your package.json file:
    "overrides": {
     "vite": "^4.0.0",
     "@vitejs/plugin-vue": "^4.0.0"
    }

Thanks for sharing details. I've included the vite-plugin-top-level-await without any additional changes, and it worked for me.

parkjinu commented 2 months ago

Here's how I resolved the issue for me:

  1. Integrated the plugin vite-plugin-top-level-await.
  2. Set the build target to browser: ['es2022'] in the quasar.config.js file.
  3. (Optional) If the issue persists, add the following code to your package.json file:
    "overrides": {
     "vite": "^4.0.0",
     "@vitejs/plugin-vue": "^4.0.0"
    }

Thank you so much.

jaderanderson commented 2 months ago

Here's how I resolved the issue for me:

  1. Integrated the plugin vite-plugin-top-level-await.
  2. Set the build target to browser: ['es2022'] in the quasar.config.js file.
  3. (Optional) If the issue persists, add the following code to your package.json file:
    "overrides": {
     "vite": "^4.0.0",
     "@vitejs/plugin-vue": "^4.0.0"
    }

This fixed my issues with production builds. I didn't needed to change the package.json just adding the plugin and the options in vite.config.ts

Thank you

RafaDev-gft commented 2 months ago

It does not work for me, I am importing the library and I put the configuration in my vite.config.ts like this, am I doing something wrong?

export default defineConfig({
  plugins: [
    topLevelAwait({
      promiseExportName: "__tla",
      promiseImportName: i => `__tla_${i}`
    }),
    react(),
    federation({
      name: "remote-user-management",
      filename: "remoteEntry.js",
      remotes: {
        remoteUtilities: "http://localhost:5001/assets/remoteEntry.js",
      },
DevShoesed commented 1 month ago

Here's how I resolved the issue for me:

  1. Integrated the plugin vite-plugin-top-level-await.
  2. Set the build target to browser: ['es2022'] in the quasar.config.js file.
  3. (Optional) If the issue persists, add the following code to your package.json file:
    "overrides": {
     "vite": "^4.0.0",
     "@vitejs/plugin-vue": "^4.0.0"
    }

Hi, i have the same issue with React application.

The workaround doesn't work for me.