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

No matching export in "global-externals:@storybook/components" #24906

Closed
qieman opened this issue Nov 20, 2023 · 3 comments
Closed

No matching export in "global-externals:@storybook/components" #24906

qieman opened this issue Nov 20, 2023 · 3 comments

Comments

@qieman
Copy link

qieman commented Nov 20, 2023

Describe the bug

When I execute the command 'yarn storybook' after completing the Storybook installation, it throws the following error:

yarn run v1.22.19
$ storybook dev -p 6006
@storybook/cli v7.5.3

info => Starting manager..
X [ERROR] No matching export in "global-externals:@storybook/components" for import "ArgsTable"

    node_modules/@storybook/addon-controls/dist/esm/ControlsPanel.js:31:9:
      31 │ import { ArgsTable, NoControlsWarning } from '@storybook/components';
         ╵          ~~~~~~~~~

X [ERROR] No matching export in "global-externals:@storybook/components" for import "NoControlsWarning"

    node_modules/@storybook/addon-controls/dist/esm/ControlsPanel.js:31:20:
      31 │ import { ArgsTable, NoControlsWarning } from '@storybook/components';
         ╵                     ~~~~~~~~~~~~~~~~~

X [ERROR] No matching export in "global-externals:@storybook/addons" for import "useEffect"

    node_modules/@storybook/addon-actions/dist/esm/preview/withActions.js:45:9:
      45 │ import { useEffect, makeDecorator } from '@storybook/addons';
         ╵          ~~~~~~~~~

X [ERROR] No matching export in "global-externals:@storybook/addons" for import "makeDecorator"

    node_modules/@storybook/addon-actions/dist/esm/preview/withActions.js:45:20:
      45 │ import { useEffect, makeDecorator } from '@storybook/addons';
         ╵                     ~~~~~~~~~~~~~

Error: Build failed with 4 errors:
node_modules/@storybook/addon-actions/dist/esm/preview/withActions.js:45:9: ERROR: No matching export in "global-externals:@storybook/addons" for import "useEffect"     
node_modules/@storybook/addon-actions/dist/esm/preview/withActions.js:45:20: ERROR: No matching export in "global-externals:@storybook/addons" for import "makeDecorator"
node_modules/@storybook/addon-controls/dist/esm/ControlsPanel.js:31:9: ERROR: No matching export in "global-externals:@storybook/components" for import "ArgsTable"      
node_modules/@storybook/addon-controls/dist/esm/ControlsPanel.js:31:20: ERROR: No matching export in "global-externals:@storybook/components" for import "NoControlsWarning"
    at failureErrorWithLog (.\node_modules\esbuild\lib\main.js:1649:15)
    at .\node_modules\esbuild\lib\main.js:1058:25
    at runOnEndCallbacks (.\node_modules\esbuild\lib\main.js:1484:45)
    at buildResponseToResult (.\node_modules\esbuild\lib\main.js:1056:7)
    at .\node_modules\esbuild\lib\main.js:1085:16
    at responseCallbacks.<computed> (.\node_modules\esbuild\lib\main.js:703:9)
    at handleIncomingPacket (.\node_modules\esbuild\lib\main.js:762:9)
    at Socket.readFromStdout (.\node_modules\esbuild\lib\main.js:679:7)
    at Socket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:376:12)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

No response

System

No response

Additional context

I also referred to this report:#20843. I didn't modify anything related to Storybook. It still throws errors.

@qieman
Copy link
Author

qieman commented Nov 20, 2023

Finally, I solved the problem by doing this:Manually installing @storybook/components @storybook/addons , clean yarn cache and remove node_modules , run the 'yarn' script ,run ’ yarn storybook‘.

@SuryaprakashCIT
Copy link

Hi @qieman

I am facing the same issue. I tired following your answer, but still facing the error.

@newlukai
Copy link

newlukai commented Nov 27, 2023

Did not work for me.

What I then did was to

  • remove the node_modules directory
  • remove the .storybook directory
  • delete all storybook deps from package.json
  • re-initialize the Storybook running npx storybook@latest init

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

No branches or pull requests

3 participants