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

[Bug]: env type is wrong from StorybookConfig in @storybook/your-framework #25739

Closed
valentinpalkovic opened this issue Jan 24, 2024 · 1 comment · Fixed by #25740
Closed

Comments

@valentinpalkovic
Copy link
Contributor

Describe the bug

The env property doesn't accept a function definition like this:

import { StorybookConfig } from "@storybook/angular";

const config: StorybookConfig = {
  stories: [...],
  framework: {
    name: "@storybook/angular"
    options: {},
  },
  env: (config) => ({
    ...config,
    FLAGS: JSON.stringify({
      flag1: true,
    }),
  }),
};

export default config;

Error:
image

The bug was introduced in 8.0.0-alpha.0 by #21555 here: https://github.com/storybookjs/storybook/pull/21555/files#diff-6ed749534ddc1242cc6f43a60dd370d916334533a03f2e0c36edb653e24eb74dR1

To Reproduce

No response

System

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 7800X3D 8-Core Processor
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    Yarn: 1.22.21 - /mnt/c/Program Files/nodejs/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm <----- active
    pnpm: 8.14.2 - /mnt/c/Program Files/nodejs/pnpm
  npmPackages:
    @storybook/addon-a11y: ^8.0.0-alpha.14 => 8.0.0-alpha.14 
    @storybook/addon-actions: ^8.0.0-alpha.14 => 8.0.0-alpha.14 
    @storybook/addon-designs: 7.0.7 => 7.0.7 
    @storybook/addon-essentials: ^8.0.0-alpha.14 => 8.0.0-alpha.14 
    @storybook/addon-interactions: ^8.0.0-alpha.14 => 8.0.0-alpha.14 
    @storybook/addon-links: ^8.0.0-alpha.14 => 8.0.0-alpha.14 
    @storybook/angular: ^8.0.0-alpha.14 => 8.0.0-alpha.14 
    @storybook/jest: 0.2.3 => 0.2.3 
    @storybook/testing-library: 0.2.2 => 0.2.2 
    chromatic: 10.0.0 => 10.0.0 
    eslint-plugin-storybook: 0.6.15 => 0.6.15 
    storybook: ^8.0.0-alpha.14 => 8.0.0-alpha.14

Additional context

No response

@shilman
Copy link
Member

shilman commented Jan 26, 2024

FWIW I don't think a TS error should ever be S2 unless it is a ubiquitous that most Storybooks will run into. The user always has the workaround of // @ts-ignore to get around it. Which sucks but is much better than our other S2 issues.

I've re-labeled this as S3 and moved it to the RC milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants