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

DocBlockBase error #109

Closed
YasKur opened this issue Jun 24, 2021 · 3 comments · Fixed by #110
Closed

DocBlockBase error #109

YasKur opened this issue Jun 24, 2021 · 3 comments · Fixed by #110
Assignees
Labels
category: bug Something isn't working

Comments

@YasKur
Copy link

YasKur commented Jun 24, 2021

Affected design types

  • figma

Describe the bug
Error 1

blocks.js:49 Uncaught TypeError: Cannot read property 'resetwrapper' of undefined
at DocBlockBase (blocks.js:49)
at renderWithHooks (react-dom.development.js:14803)
at mountIndeterminateComponent (react-dom.development.js:17482)
at beginWork (react-dom.development.js:18596)
at HTMLUnknownElement.callCallback (react-dom.development.js:188)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
at invokeGuardedCallback (react-dom.development.js:292)
at beginWork$1 (react-dom.development.js:23203)
at performUnitOfWork (react-dom.development.js:22154)
at workLoopSync (react-dom.development.js:22130)

Error 2:
The above error occurred in the component:
in DocBlockBase (created by Figma)
in Figma (at figma-doc-page/index.jsx:13)
in page
in div (created by Context.Consumer)
in Styled(div) (created by DocsContainer)
in div (created by Context.Consumer)
in Styled(div) (created by DocsContainer)
in MDXProvider (created by DocsContainer)
in ThemeProvider (created by DocsContainer)
in SourceContainer (created by DocsContainer)
in DocsContainer

To Reproduce

  1. Run storybook.
  2. Go to page component, click on tab Docs and see this error in console.

In version 6.0.0-alpha.3 all work correct, but in current version 6.0.0 u can see this errors.

export default {
  title: 'Example'
  component: Example,
  decorators: [withDesign],
  parameters: {
    docs: {
      page: () => <Figma url={url} />
    },
  },
};

Versions
└─┬ @storybook/addon-docs@6.0.27
└─┬ @storybook/core@6.0.27
└── @storybook/ui@6.0.27
"storybook-addon-designs": "6.0.0";

@YasKur YasKur added the category: bug Something isn't working label Jun 24, 2021
@pocka
Copy link
Collaborator

pocka commented Jun 24, 2021

It seems this causes the error but I have no idea why that import would be undefined...
I introduced changes to the file in 3bf4551. I believe it's compatible even with Storybook v6.0.x.

@YasKur
Can you share a reproduction repository or sandbox? Also, the version of @storybook/components you're using would be helpful.

@YasKur
Copy link
Author

YasKur commented Jun 24, 2021

@pocka components storybook

"@storybook/addon-actions": "6.0.27",
"@storybook/addon-backgrounds": "6.0.27",
"@storybook/addon-docs": "6.0.27",
"@storybook/addon-links": "6.0.27",
"@storybook/addons": "6.0.27",
"@storybook/preset-create-react-app": "3.1.4",
"@storybook/react": "6.0.27",

error with - "storybook-addon-designs": "6.0.0", but "storybook-addon-designs": "6.0.0-alpha.3" work good :)

@pocka pocka self-assigned this Jul 3, 2021
pocka added a commit that referenced this issue Jul 3, 2021
#109

The export, components.resetwrapper is unstable between 6.0 versions
and that causes a runtime error. Because it seems almost impossible
to import the component among Storybook 6.x, I simply wrote an imitation
component to eliminate the problem at all.
@pocka pocka closed this as completed in #110 Jul 3, 2021
@pocka
Copy link
Collaborator

pocka commented Jul 3, 2021

The patch is available in v6.0.1 and v5.4.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants