react-docgen
react-docgen copied to clipboard
Using the export keyword between a decorator and a class is not allowed
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
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.
Thank you for the quick response. No worries, there's no rush from my end :)
@danez I am getting the same exact errors when trying to migrate to v9.1.16. Any idea if react-docgen fixed the issue?