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]: Storybook build broken when updating from v7.0.6 to v7.0.9 #22430

Closed
dgonzalezr opened this issue May 6, 2023 · 4 comments
Closed

[Bug]: Storybook build broken when updating from v7.0.6 to v7.0.9 #22430

dgonzalezr opened this issue May 6, 2023 · 4 comments
Labels
bug core needs more info nx Prioritize Nx compatibility for angular

Comments

@dgonzalezr
Copy link

Describe the bug

The Storybook build is broken in an Nx monorepo when updating from v7.0.6. I've tested with v7.0.7 and v7.0.8 separately and the build has broken with the same error:

CleanShot 2023-05-06 at 12 28 12@2x

To Reproduce

You can see the related change on our public repo, here in this PR.
Checkout the repo from this specific branch: https://github.com/Endava/bee-q/tree/chore/%40storybook

npm run build

the build broke with the following output:

>  NX  Storybook builder starting ...
info => Cleaning outputDir: /dist/storybook/bee-q
info => Loading presets
info => Building manager..
✘ [ERROR] No matching export in "global-externals:@storybook/core-events" for import "DOCS_PREPARED"
    node_modules/@storybook/blocks/node_modules/@storybook/preview-api/dist/chunk-34WDGA45.mjs:6:356:
      6 │ ..._CHANGED, STORY_PREPARED, DOCS_PREPARED, STORY_MISSING, STORY_TH...
        ╵                              ~~~~~~~~~~~~~
✘ [ERROR] No matching export in "global-externals:@storybook/core-events" for import "DOCS_PREPARED"
    node_modules/@storybook/docs-tools/node_modules/@storybook/preview-api/dist/chunk-34WDGA45.mjs:6:356:
      6 │ ..._CHANGED, STORY_PREPARED, DOCS_PREPARED, STORY_MISSING, STORY_TH...
        ╵                              ~~~~~~~~~~~~~
 >  NX   Build failed with 2 errors:
   node_modules/@storybook/blocks/node_modules/@storybook/preview-api/dist/chunk-34WDGA45.mjs:6:356: ERROR: No matching export in "global-externals:@storybook/core-events" for import "DOCS_PREPARED"
   node_modules/@storybook/docs-tools/node_modules/@storybook/preview-api/dist/chunk-34WDGA45.mjs:6:356: ERROR: No matching export in "global-externals:@storybook/core-events" for import "DOCS_PREPARED"
   Pass --verbose to see the stacktrace.

 

 >  NX   Running target "bee-q:storybook-build" failed

   Failed tasks:
   
   - bee-q:storybook-build
   
   Hint: run the command with --verbose for more details.

   View structured, searchable error logs at https://cloud.nx.app/runs/HOxaLg9NJW

ERROR: "build:storybook" exited with 1

System

System:
    OS: macOS 13.2.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 18.16.0 - ~/.volta/tools/image/node/18.16.0/bin/node
    Yarn: 3.4.1 - ~/.volta/tools/image/yarn/3.4.1/bin/yarn
    npm: 9.5.0 - ~/.volta/tools/image/npm/9.5.0/bin/npm
  Browsers:
    Safari: 16.3
  npmPackages:
    @storybook/addon-a11y: 7.0.6 => 7.0.6 
    @storybook/addon-actions: 7.0.6 => 7.0.6 
    @storybook/addon-docs: 7.0.6 => 7.0.6 
    @storybook/addon-essentials: 7.0.6 => 7.0.6 
    @storybook/addon-links: 7.0.6 => 7.0.6 
    @storybook/mdx2-csf: 1.0.0 => 1.0.0 
    @storybook/web-components: 7.0.6 => 7.0.6 
    @storybook/web-components-webpack5: 7.0.6 => 7.0.6


### Additional context

_No response_
@shilman
Copy link
Member

shilman commented May 8, 2023

Hi @dgonzalezr! Thanks for reporting. To clarify, the problem DOES NOT exist in 7.0.6 and DOES exist in 7.0.7/7.0.8/7.09?

@shilman shilman added core nx Prioritize Nx compatibility for angular and removed needs triage labels May 8, 2023
@shilman
Copy link
Member

shilman commented May 8, 2023

@dgonzalezr Can you try clearing your package lock & node_modules and reinstalling? The DOCS_PREPARED event was introduced in 7.0.7 and this error would occur if an older version of @storybook/core-events was being used. Alternatively you could try npm ls @storybook/core-events to see which versions are being used in your project.

@dgonzalezr
Copy link
Author

Hi @dgonzalezr! Thanks for reporting. To clarify, the problem DOES NOT exist in 7.0.6 and DOES exist in 7.0.7/7.0.8/7.09?

Hi @shilman , yes, the problem DOES NOT exist in v7.0.6 of storybook. Regarding cleaning the npm_modules I did that and it is something failing also on our CI pipeline.

@dgonzalezr
Copy link
Author

Hi @shilman , getting back to you. You were right, our dependency update bot didn't pick the storybook package when updating all the @storybook/* dependencies, therefore a wrong version of @storybook/core-events was used. Cleaning the package-lock and node-modules and bumping storybook fixed the issue. I'm closing this ticket now.
Thanks a lot 🙌🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core needs more info nx Prioritize Nx compatibility for angular
Projects
None yet
Development

No branches or pull requests

2 participants