originjs/vite-plugin-federation

Adding and then removing `manualChunks` causes runtime error

echjordan0 opened this issue · 0 comments

Versions

  • vite-plugin-federation: v1.1.8
  • vite: 2.9.16

Reproduction

Additional Details

Steps to reproduce

  1. Add a manual chunk in the remote's Vite config (it does not seem library specific but I was chunking a PDF library) and build
      rollupOptions: {
        output: {
          manualChunks: {
            'vue-pdf-embed/dist/vue2-pdf-embed': ['vue-pdf-embed/dist/vue2-pdf-embed'],
          },
        },
      },
  1. Later remove this piece of the config bc you no longer want to create a separate chunk
    Screenshot 2024-02-13 at 5 42 14 PM
  2. Build for production
  3. Try to fetch the remote receive the following error:
Screenshot 2024-02-13 at 5 44 56 PM

Interestingly, I can work around this error by changing the config to

     rollupOptions: {
        output: {
          manualChunks: {},
        },
      },

But it seems very strange that I'd need to do so. Perhaps it's not properly cleaning up the options when they're removed entirely?

Thank you!

What is Expected?

What is actually happening?