addon-styling icon indicating copy to clipboard operation
addon-styling copied to clipboard

auto-configuration: don't duplicate addon registration

Open ShaunEvening opened this issue 1 year ago • 3 comments

The auto configure script doesn't check to see if the addon already exists in the addon array before adding it again

ShaunEvening avatar Jul 11 '23 20:07 ShaunEvening

Hi, I'm seeing the duplicate addon warning in a simple Storybook 7 set up with the @storybook/react-webpack5 framework and only '@storybook/addon-styling' in my addons array.

It looks like manager.ts, which includes the addons.register call, is getting included in two bundles that are both imported, so register is called twice. I can't figure out where each one is originally coming from. They each have different file contents since they have different imports that get inlined in the file. I see you followed the addon-kit template pretty closely too.

Screenshot 2023-08-04 at 5 25 49 PM Screenshot 2023-08-04 at 5 30 50 PM

dkario avatar Aug 05 '23 00:08 dkario

Hey @dkario your issue pertains to #80, this is a to-do item, specifically for the codemod

ShaunEvening avatar Aug 15 '23 18:08 ShaunEvening

Awesome, thanks for the update

dkario avatar Aug 17 '23 22:08 dkario