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.

Addon-docs: Error: Evaluation failed: TypeError: Cannot convert a Symbol value to a string

See original GitHub issue

Describe the bug The error Error: Evaluation failed: TypeError: Cannot convert a Symbol value to a string is thrown at runtime for a story under the cirucmenstance described below. To Reproduce Steps to reproduce the behavior:

  1. Have story wrapped in a React.Profiler
  2. Have docs addon enabled
  3. Open story in story book Expected behavior It should not throw this error

Using storybook v6.0-rc3

Traced it down that the error originates here: https://github.com/algolia/react-element-to-jsx-string/blob/c4908bbb52e58e104c9d42d1ceaff80d53fd4bdf/src/formatter/formatReactElementNode.js#L122

The react-element-to-jsx-string package is a dependency is a dependency of the docs addon.

While I dont have the time to build a repro case right now, I think it should be fairly easy to do with the information provided. Hope this helps. Best regards.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

11reactions
danielthedifficultcommented, Aug 5, 2021

As a workaround you can set the docs.source.type story parameter to "code".

It is not friendly for using template mode. The code will be displayed as

(args) => <Component {...args} />;

How to write stories if set type to code???

Here’s how, it doesn’t affect the story, only the “Docs” page/addon.

export const MyStory = Template.bind({});
MyStory.args = {
    key: "Property",
}
/* 👇🏻 here is the workaround */
  MyStory.parameters = {
    docs: {
      source: {
        code: "Disabled for this story, see https://github.com/storybookjs/storybook/issues/11554"
      }
    }
  }
6reactions
shilmancommented, Sep 1, 2020

As a workaround you can set the docs.source.type story parameter to "code".

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot convert a Symbol value to a string - Stack Overflow
I found the problem. My project is a repository of components using storybook, and turns out that passing fragments through stories is not ......
Read more >
[VUE] TypeError: Cannot convert a Symbol value to a string
Hi, I was using Handsontable pro version and today I have updated to latest version 7.2.2 then onwards I get this error whenever...
Read more >
Receiving error "Cannot convert a Symbol value to a string" at ...
I am getting an error while publishing message from one web Component: [error = TypeError: Cannot convert a Symbol value to a string...
Read more >
@storybook/addon-controls | Yarn - Package Manager
Storybook Controls gives you a graphical UI to interact with a component's arguments dynamically, without needing to code. It creates an addon panel...
Read more >
The Difference Between Node.js 10 LTS and Node.js 12 LTS
The JSON variant of the API documentation is no longer ... The readable.unshift() method now correctly converts strings to buffers.
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