vite icon indicating copy to clipboard operation
vite copied to clipboard

[Bug]: Partial shared package

Open danieldaeschle opened this issue 7 months ago • 2 comments
trafficstars

Describe the bug

We try to override a shared package partially (sub path). In our case it is

  shared: {
      react: {
        singleton: true,
      },
      'react-dom': {
        singleton: true,
      },
      '@eschbach/app-sdk/extensions/shared/v1': {
        singleton: true,
      },
      ...mfOptions.shared,
    },

The problem looks like it's here:

Image It is removing the path of the provided package using removePathFromNpmPackage and cannot find the key anymore.

https://github.com/module-federation/core/issues/3682#issuecomment-2799878077

Version

.

Reproduction

Company internal code, I'm sorry.

Relevant log output


Validations

danieldaeschle avatar Apr 17 '25 11:04 danieldaeschle

A workaround was found: declaring both.

'@eschbach/app-sdk/extensions/shared/v1': {
    singleton: true,
},
'@eschbach/app-sdk': {
    singleton: true,
},

danieldaeschle avatar Apr 17 '25 11:04 danieldaeschle

Thanks for your feedback May I ask you to drop a PR to solve this issue?

gioboa avatar Apr 17 '25 11:04 gioboa