Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REGRESSION] Storybook adds displayName and __docgenInfo in TS enum #17407

Closed
totszwai opened this issue Feb 3, 2022 · 7 comments
Closed

[REGRESSION] Storybook adds displayName and __docgenInfo in TS enum #17407

totszwai opened this issue Feb 3, 2022 · 7 comments

Comments

@totszwai
Copy link

totszwai commented Feb 3, 2022

Describe the bug
Regression of #9832

The enum, typical normal enum:

/**
 * Supported ColumnLayout, refer to UX documentation for their naming and styling
 */
export enum SupportedColumnLayout {
  XXLarge = 'xxlarge',
  XLarge = 'xlarge',
  Large = 'large',
  Medium = 'medium',
  Small = 'small'
}

The code in story:

  const entries = _.entries(SupportedColumnLayout);
  console.log(SupportedColumnLayout);
  const options = entries.map(([label, value]) => {
    return { label, value };
  });

image

image

To Reproduce

  1. Use latest Storybook
  2. Start storybook

System
npx sb@next info

Environment Info:

System:
OS: Linux 5.13 Ubuntu 21.10 21.10 (Impish Indri)
CPU: (16) x64 Intel(R) Xeon(R) Silver 4108 CPU @ 1.80GHz
Binaries:
Node: 12.22.9 - ~/.config/nvm/versions/node/v12.22.9/bin/node
npm: 6.14.16 - ~/projects/gravity/ui-components/packages/ui-components/node_modules/.bin/npm
Browsers:
Chrome: 97.0.4692.99
Firefox: 96.0
npmPackages:
@storybook/addon-actions: 6.4.18 => 6.4.18
@storybook/addon-essentials: 6.4.18 => 6.4.18
@storybook/addon-knobs: ^6.3.1 => 6.4.0
@storybook/addon-links: 6.4.18 => 6.4.18
@storybook/react: 6.4.18 => 6.4.18

@totszwai totszwai changed the title Storybook adds displayName and __docgenInfo in enum [REGRESSION] Storybook adds displayName and __docgenInfo in TS enum Feb 3, 2022
@totszwai
Copy link
Author

totszwai commented Mar 4, 2022

Knock knock? Still there in 6.4.19

@evont
Copy link

evont commented Apr 11, 2022

Same here, any idea now?

@totszwai
Copy link
Author

totszwai commented Apr 14, 2022

Is there another workaround on this issue?
We cannot use the workaround suggested in the other thread. Using the following in main.js fixed the __docgenInfo issue, but that will break all the Controls.

typescript: { reactDocgen: 'react-docgen' },

None of the controls in the Control Panels work, they are all blank after.

@shilman
Copy link
Member

shilman commented Apr 17, 2022

Do you a have a reproduction repo you can share? If not, can you create one? See how to create a repro. Thank you! 🙏

@totszwai
Copy link
Author

@shilman this is literally #9832 which was never fixed and was closed @lgraziani2712 for no reason. These a reproduction repo there.

@shilman
Copy link
Member

shilman commented Apr 18, 2022

@totszwai there is no repo there, just a code snippet. the issue was closed because @lgraziani2712 said switching to react-docgen fixed it for him. what am i missing?

@benmcginnis
Copy link

This also is happening for me in storybook 7 using this setup:

import { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
  stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
  core: {
    builder: "@storybook/builder-vite",
  },
  addons: [
    "@storybook/addon-a11y",
    "@storybook/addon-coverage",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions",
    "@storybook/addon-links",
    "@storybook/addon-designs",
  ],
  framework: {
    name: "@storybook/react-vite",
    options: {},
  },
  staticDirs: ["./static"],
  docs: {
    autodocs: "tag",  // turning on autodocs is what adds displayName and __docGenInfo to my stories
  },
  features: {},
};
export default config;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants