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' does not exist in type 'StorybookConfig' #21733

Closed
zigang93 opened this issue Mar 22, 2023 · 1 comment · Fixed by #21732
Closed

[Bug] 'env' does not exist in type 'StorybookConfig' #21733

zigang93 opened this issue Mar 22, 2023 · 1 comment · Fixed by #21732

Comments

@zigang93
Copy link
Contributor

Describe the bug

// main.ts

import type { StorybookConfig } from '@storybook/nextjs'

const config: StorybookConfig = {
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
  staticDirs: ['../public'],
  addons: [
    'storybook-dark-mode',
    '@storybook/addon-links',
    '@storybook/addon-essentials',
    '@storybook/addon-interactions',
  ],
  core: {
    disableTelemetry: true,
  },
  framework: {
    name: '@storybook/nextjs',
    options: {
      strictMode: true,
    },
  },
  docs: {
    // see below for alternatives
    defaultName: 'Docs',
    // set to change the name of generated docs entries
    autodocs: true,
  },
// error happened at here
  env: (config: any) => ({
    ...config,
    NEXT_PUBLIC_WCS_BE_API_HOST_URL: 'https://example.com/',
    // fake https for chromatic deployment
    NEXT_PUBLIC_QIII_SOCKET_URL: 'https://socket.example.com',
  }),
}
module.exports = config

show error:

Type '{ stories: string[]; staticDirs: string[]; addons: string[]; core: { disableTelemetry: true; }; framework: { name: "@storybook/nextjs"; options: { strictMode: true; }; }; docs: { defaultName: string; autodocs: true; }; env: (config: any) => any; }' is not assignable to type 'StorybookConfig'.
  Object literal may only specify known properties, and 'env' does not exist in type 'StorybookConfig'.

To Reproduce

No response

System

System:
    OS: macOS 13.2.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 111.0.5563.64
    Safari: 16.3
  npmPackages:
    @storybook/addon-actions: ^7.0.0-rc.5 => 7.0.0-rc.5 
    @storybook/addon-essentials: ^7.0.0-rc.5 => 7.0.0-rc.5 
    @storybook/addon-interactions: ^7.0.0-rc.5 => 7.0.0-rc.5 
    @storybook/addon-links: ^7.0.0-rc.5 => 7.0.0-rc.5 
    @storybook/csf: 0.0.2-next.10 => 0.0.2-next.10 
    @storybook/nextjs: ^7.0.0-rc.5 => 7.0.0-rc.5 
    @storybook/react: ^7.0.0-rc.5 => 7.0.0-rc.5 
    @storybook/testing-library: ^0.0.14-next.1 => 0.0.14-next.1 
    @storybook/theming: ^7.0.0-rc.5 => 7.0.0-rc.5

Additional context

No response

@shilman
Copy link
Member

shilman commented Mar 25, 2023

Yippee!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-rc.8 containing PR #21732 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb@next upgrade --prerelease

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

Successfully merging a pull request may close this issue.

2 participants