question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Storybook Docs 6.1.1 not able to set components to MDXProvider as global scope

See original GitHub issue

Describe the bug After upgrading from 6.0.25 Storybook Docs no longer recognizes components passed to MDXProvider as global scope. It was working with the following in preview.js:

export const parameters = {
  docs: {
    inlineStories: true,
    theme: theme,
    components: {
      SomeComponent: SomeComponent,
    },
  },
};

Has the way to configure this changed in 6.1?

To Reproduce Steps to reproduce the behavior:

  1. Update preview.js with a similar config to set SomeComponent with global scope
  2. In component mdx docs use SomeComponent
  3. Notice warning Component SomeComponent was not imported, exported, or provided by MDXProvider as global scope

Expected behavior SomeComponent is available to use in mdx docs on a global level.

Screenshots If applicable, add screenshots to help explain your problem.

Code snippets If applicable, add code samples to help explain your problem.

System

Environment Info:

  System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm
  Browsers:
    Chrome: 87.0.4280.88
    Edge: 87.0.664.60
    Firefox: 84.0
    Safari: 14.0.2
  npmPackages:
    @storybook/addon-a11y: ^6.1.1 => 6.1.1 
    @storybook/addon-actions: ^6.1.1 => 6.1.1 
    @storybook/addon-controls: ^6.1.1 => 6.1.1 
    @storybook/addon-docs: ^6.1.1 => 6.1.1 
    @storybook/addon-storysource: ^6.1.1 => 6.1.1 
    @storybook/addon-viewport: ^6.1.1 => 6.1.1 
    @storybook/addons: ^6.1.1 => 6.1.1 
    @storybook/react: ^6.1.1 => 6.1.1 
    @storybook/source-loader: ^6.1.1 => 6.1.1 
    @storybook/theming: ^6.1.1 => 6.1.1 
    @storybook/web-components: ^6.1.1 => 6.1.1 

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shilmancommented, Feb 23, 2021

That’s great! Closing then… 😅

1reaction
Niznikrcommented, Feb 23, 2021

@shilman I do not as it is a private project. I did update to 6.2.0-beta.1 and things are working as expected again 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

MDX - Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >
MDX and Decorator with Storybook 6.1+ - lit html
All I want is when from the toolbar, a global value is set, I want to set that value on the root of...
Read more >
Documenting design systems with Storybook Docs
Storybook is a playground for UI development. It's a great tool to help designers, project managers, and developers understand and visualize ...
Read more >
Administrator Guide - SAP Help Portal
Using SAP Enterprise Portal iViews to view Analysis documents. ... If not, the setup installs this component automatically.
Read more >
[Solved]-MDX - Storybook + React + Typescript-Reactjs
... MDXDefaultShortcode(props) { console.warn("Component " + name + " was not imported, exported, or provided by MDXProvider as global scope") return <div ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found