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.

Docgen: Errors on TS components whose names are keywords

See original GitHub issue

It appears that a change introduced in 6.0.0-beta.24 is causing my storybook to fail to load:

image

I’m not sure exactly what is going on here because source maps don’t seem to be working.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

18reactions
pelotomcommented, Jul 28, 2020

This seems to happen in cases where a static property is assigned to a component which is exported at its declaration site, e.g.

export default function Foo() {
  return null;
}
Foo.x = 42;

A workaround seems to be separating the export from the declaration:

function Foo() {
  return null;
}
Foo.x = 42;

export default Foo;

Class components with static properties suffer from the same problem:

export default class Foo() {
  static x = 42;
  render() { return null; }
}

and the workaround is the same:

class Foo() {
  static x = 42;
  render() { return null; }
}

export default Foo;
3reactions
phatNfqAsiacommented, Jan 10, 2021

I also experience this when my 'default.[exported-component]` is not understood by Storybook, which should be consider as unacceptable because the way I write code should not be affected by how a document-purpose framework works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - Nintex help documentation
See the errors listed below to see how to troubleshoot them. You'll find the error codes in the error message that Nintex Drawloop...
Read more >
@component-controls/react-docgen-info - npm
Start using @component-controls/react-docgen-info in your project by running `npm i ... By default, a return statement at the top level raises an error....
Read more >
C Coding Standard
Parens () with Key Words and Functions Policy. Do not put parens next to keywords. Put a space between. Do put parens next...
Read more >
OpenFOAM User Guide, Version 10
cluded in its entirety in unmodified form along with one or more other ... The blocks are specified in a list under the...
Read more >
R Packages (2e) - 17 Function documentation
17.7.3 Child documents · The name “roxygen” is a nod to the Doxygen documentation generator, which inspired the development of an R package...
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