react-docgen icon indicating copy to clipboard operation
react-docgen copied to clipboard

Using the export keyword between a decorator and a class is not allowed

Open helfi92 opened this issue 6 years ago • 3 comments

I'm attempting to migrate react-styleguidist from v8 -> v9 and noticed that [email protected] and beyond starts showing errors in the terminal:

You can now view your style guide in the browser:

  Local:            http://localhost:6060/
  On your network:  http://10.242.26.49:6060/

Warning: Cannot parse src/components/Markdown/index.jsx: SyntaxError: Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (28:0)

It usually means that react-docgen does not understand your source code, try to file an issue here:
https://github.com/reactjs/react-docgen/issues

Warning: Cannot parse src/components/Search/index.jsx: SyntaxError: Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (59:0)

It usually means that react-docgen does not understand your source code, try to file an issue here:
https://github.com/reactjs/react-docgen/issues

Warning: Cannot parse src/components/Snackbar/index.jsx: SyntaxError: Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (53:0)

It usually means that react-docgen does not understand your source code, try to file an issue here:
https://github.com/reactjs/react-docgen/issues

Warning: Cannot parse src/components/SpeedDial/index.jsx: SyntaxError: Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (18:0)

It usually means that react-docgen does not understand your source code, try to file an issue here:
https://github.com/reactjs/react-docgen/issues

This warning does not show on [email protected]. I think https://github.com/styleguidist/react-styleguidist/pull/1200 may be the culprit. Would this be a react-docgen issue? /cc @danez

helfi92 avatar Feb 25 '19 13:02 helfi92

react-docgen in 3.0.0 changed to use the new decorators proposal be default. Which in retrospect was a big mistake as it is already abandoned and a complete new specification exists.🙄

But anyway, in order to fix this issue you are having, you probably will have to wait till https://github.com/styleguidist/react-styleguidist/pull/1288 is merged and released. In the latest version of react-docgen we now correctly read babel configs, which in your case would enable the decorators-legacy support in your project instead of the "new-yet-abandonend" decorators proposal. I'm sorry for the inconvenience.

danez avatar Feb 25 '19 17:02 danez

Thank you for the quick response. No worries, there's no rush from my end :)

helfi92 avatar Feb 25 '19 18:02 helfi92

@danez I am getting the same exact errors when trying to migrate to v9.1.16. Any idea if react-docgen fixed the issue?

helfi92 avatar Sep 19 '19 15:09 helfi92