storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.68k stars 9.32k forks source link

[Bug]: build error (addons@7.6.20 w/react@18.3.1) #29192

Closed jongjunpark closed 1 month ago

jongjunpark commented 1 month ago

Describe the bug

=> Failed to build the preview
../../node_modules/.pnpm/@storybook+addons@7.6.20_react-dom@18.3.1_react@18.3.1/node_modules/@storybook/addons/dist/index.mjs (3:24): Expected ',', got ':' (Note that you need plugins to import files that are not JavaScript)
file: /Users/parkjongjun/Documents/company/clay/node_modules/.pnpm/@storybook+addons@7.6.20_react-dom@18.3.1_react@18.3.1/node_modules/@storybook/addons/dist/index.mjs:3:24

1: export { addons, mockChannel } from '@storybook/manager-api';
2: export { HooksContext, applyHooks, makeDecorator, useArgs, useCallback, useChannel, useEffect, useGlobals, useMemo, u...
3: export { Addon_TypesEnum as types } from '@storybook/types';
                           ^

After deleting the code(export { Addon_TypesEnum as types } from '@storybook/types';) on the line where the error occurred, the build was successful.

Reproduction link

-

Reproduction steps

No response

System

Storybook Environment Info:

  System:
    OS: macOS 13.5.2
    CPU: (12) arm64 Apple M2 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.6.7 - /usr/local/bin/npm <----- active
    pnpm: 8.15.5 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 129.0.6668.59
    Safari: 16.6
  npmPackages:
    @storybook/addon-essentials: ^8.2.5 => 8.3.2
    @storybook/addon-interactions: ^8.2.5 => 8.3.2
    @storybook/addon-links: ^8.2.5 => 8.3.2
    @storybook/addons: ^7.6.17 => 7.6.20
    @storybook/blocks: ^8.2.5 => 8.3.2
    @storybook/core-common: ^8.2.5 => 8.3.2
    @storybook/manager-api: ^8.2.5 => 8.3.2
    @storybook/react: ^8.2.5 => 8.3.2
    @storybook/react-vite: ^8.2.5 => 8.3.2
    @storybook/testing-library: ^0.0.14-next.2 => 0.0.14-next.2
    @storybook/theming: ^8.2.5 => 8.3.2
    chromatic: ^6.22.0 => 6.24.1
    storybook: ^8.2.9 => 8.3.0

Additional context

No response

amangcod3 commented 1 month ago

image Since @storybook/addons is deprecated and its functionality has been moved to new packages, this might be causing the issue . I think some changes are required in configuration and import statements .

jongjunpark commented 1 month ago

@amangcod3 thanks!!!!! :)