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

fix(storybook): Resolve MDX Block Loading Issues in Storybook #2396

Conversation

WinkeeFace
Copy link
Contributor

Description:

This PR resolves runtime errors encountered when using MDX documentation in Storybook by pre-bundling the @storybook/addon-docs/blocks module. The fix ensures compatibility with Vite's dependency optimization process during dynamic imports.

Context:

The issue arises because Vite requires explicit pre-bundling of dynamically imported modules for compatibility during development. Without pre-bundling, Storybook fails to load MDX documentation correctly, leading to runtime errors. The solution modifies the .storybook/main.ts configuration to include @storybook/addon-docs/blocks in the optimizeDeps.include array.

Changes:

  • Updated .storybook/main.ts to pre-bundle @storybook/addon-docs/blocks.
  • Added necessary comments to the configuration for clarity and maintainability.

References:

@WinkeeFace WinkeeFace added this to the 15.0.0 milestone Jan 20, 2025
@WinkeeFace WinkeeFace self-assigned this Jan 20, 2025
Copy link

changeset-bot bot commented Jan 20, 2025

🦋 Changeset detected

Latest commit: 76c6f95

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ebay/ebayui-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@agliga
Copy link
Contributor

agliga commented Jan 21, 2025

Closing, no changeset is needed since this original PR was merged and this isnt a feature that will be released but only an internal change.

@agliga agliga closed this Jan 21, 2025
@agliga agliga removed this from the 15.0.0 milestone Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

5 participants