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

can't convert symbol to string error with React.lazy and Suspense #14020

Closed
JimmyRowland opened this issue Feb 23, 2021 · 2 comments
Closed

can't convert symbol to string error with React.lazy and Suspense #14020

JimmyRowland opened this issue Feb 23, 2021 · 2 comments

Comments

@JimmyRowland
Copy link

Describe the bug
We are using https://react.i18next.com/ for localization and we are trying to write stories for components that use i18next. Those components need to be wrapped by Suspense as translation files are lazy loaded. However, storybook returns the error can't convert symbol to string when we wrap stories with Suspense in decorators.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/currying-mountain-3y6b3?file=/src/stories/1-Button.stories.js
  2. Click on the story Button -> LazyLoad
  3. See error can't convert symbol to string

I did not set up i18next in the code example. I suspect storybook can't handle lazy load properly

Expected behavior
Storybook should render a button with text LazyLoad

@zdila
Copy link

zdila commented Mar 29, 2021

Same issue if used in decorators:

  decorators: [
    (Story) => (
      <Suspense fallback="Loading...">
        <Story />
      </Suspense>
    ),
  ],

Maybe related: #11554

@shilman
Copy link
Member

shilman commented Mar 29, 2021

closing as dupe to #11554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants