vite-plugin-federation icon indicating copy to clipboard operation
vite-plugin-federation copied to clipboard

Vue SSR - Entry module cannot be external

Open reiyanyan opened this issue 1 year ago • 7 comments

Versions

  • vite-plugin-federation: 1.3.2
  • vite: 4.0.3

Reproduction

anyone had to tried vikejs-ssr

federation({ ... shared: ["vue"] })

the build command of vite build produced an error below. But, if shared: ['vue'] was removed, the build was succeed, but the reactive of vue doesn't work :/

Entry module "vue" cannot be external.

Steps to reproduce

  • Clone repo https://github.com/reiyanyan/vite-ssr-federation.git
  • Trying to run build or dev
  • vite.config with or without shared:['vue']

What is Expected?

running well with reactivity of shared vue

What is actually happening?

getting error while buildiing with shared vue

reiyanyan avatar Oct 09 '23 06:10 reiyanyan

I have same problem

mannymu avatar Dec 06 '23 05:12 mannymu

Same problem with react and react-dom in shared.

Config:

federation({
      name: 'user',
      filename: 'remoteEntry.js',
      exposes: {
        './Profile': './src/Profile.tsx',
      },
       shared: ["react", "react-dom"]
    })

sedx avatar Dec 14 '23 10:12 sedx

I have the same problem.

The config should allow something like that :

federation({
      name: 'my-federation-entry',
      filename: 'remoteEntry.js',
      exposes: {
        './A': './src/A.tsx',
      },
       shared: ["some-shared-lib" ],
       externals: {
          react: "React",
          'react-dom' : "ReactDOM",
         }
    })

hadarge avatar Jan 07 '24 17:01 hadarge

I have the same issue.

ChenMichaeliPri avatar Jan 07 '24 20:01 ChenMichaeliPri

Hi, I have the same problem as well, I would really appreciate any help!

Adi1231234 avatar Jan 07 '24 22:01 Adi1231234