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.

MUI v5 does not appear in Storybook Docs tab?

See original GitHub issue

I was working on Material UI v4 but after the release of MUI (Material UI V5) I have shifted on that but after shifting I cant see anything on storybook docs tab. Material-UI (V5) Screenshot 2021-09-30 at 5 01 50 PM Screenshot 2021-09-30 at 5 01 56 PM

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

I Can’t see anything on the Storybook docs tab after upgrading to V5.

Expected Behavior 🤔

It should the Docs on the storybook.

Steps to Reproduce 🕹

Git repository:- https://github.com/vikas990/bug.git Steps:

  1. npm install
  2. npm run storybook

Context 🔦

I m try to document the design on my website.

Your Environment 🌎

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
siriwatknpcommented, Oct 3, 2021

I tried the repo you provide with these adjustments and it works.

.storybook/preview.js

import CssBaseline from "@mui/material/CssBaseline";
import { ThemeProvider, createTheme } from "@mui/material/styles";

import { ThemeProvider as EmotionThemeProvider } from "emotion-theming";

const defaultTheme = createTheme();

const withThemeProvider = (Story, context) => {
  return (
    <EmotionThemeProvider theme={defaultTheme}>
      <ThemeProvider theme={defaultTheme}>
        <CssBaseline />
        <Story {...context} />
      </ThemeProvider>
    </EmotionThemeProvider>
  );
};

export const decorators = [withThemeProvider];

export const parameters = {
  actions: { argTypesRegex: "^on[A-Z].*" },
  controls: {
    matchers: {
      color: /(background|color)$/i,
      date: /Date$/,
    },
  },
};

.storybook/main.js

const path = require("path");
const toPath = (filePath) => path.join(process.cwd(), filePath);

module.exports = {
  stories: [
    "../stories/**/*.stories.mdx",
    "../stories/**/*.stories.@(js|jsx|ts|tsx)",
  ],
  addons: [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-docs",
  ],
  webpackFinal: async (config) => {
    return {
      ...config,
      resolve: {
        ...config.resolve,
        alias: {
          ...config.resolve.alias,
          "@emotion/core": toPath("node_modules/@emotion/react"),
          "emotion-theming": toPath("node_modules/@emotion/react"),
        },
      },
    };
  },
};
Screen Shot 2564-10-03 at 10 08 50

also this issue is duplicated with #24282 (will update the migration doc)

0reactions
vikas990commented, Oct 3, 2021

it’s working now thank you for the help and for the quick response.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Material-ui v5 Documentation does not render in docs tab
I am aware of this issue, however this is a diffrent issue to mine. They are talking about themes, i cant even get...
Read more >
After Using Material-UI v5 (MUI) i can't see anything on ...
I was working on Material UI v4 but after the release of MUI (Material UI V5) I have shifted on that but after...
Read more >
Troubleshooting - Material UI - MUI
Troubleshooting. This document covers known issues and common problems encountered when migrating from Material UI v4 to v5.
Read more >
DocsPage - Storybook - JS.ORG
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 >
Storybook and Figma
Storybook is an open source tool for developing, testing, and documenting UI components across many. Use Storybook to: Create code-based...
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