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

Open
#333 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
react, typescript
Domain
documentation

Research direction

Reproduce the warning using the react-styleguidist versions named in the report and the four reported JSX paths: src/components/Markdown/index.jsx, Search/index.jsx, Snackbar/index.jsx, and SpeedDial/index.jsx. Compare the parser behavior around decorators and exports; done means these files no longer produce the reported syntax warning during documentation generation.

Written by the indexing model from the issue text.

Description

upstream

I'm attempting to migrate react-styleguidist from v8 -> v9 and noticed that react-styleguidist@8.0.5 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 react-styleguidist@8.04. I think https://github.com/styleguidist/react-styleguidist/pull/1200 may be the culprit. Would this be a react-docgen issue? /cc @danez

Dominant language
TypeScript
Stars
3.8k
Forks
316
Avg merge
3h 28m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reactjs/react-docgen

All issues in reactjs/react-docgen

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.