-
-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React-docgen fails to parse components with optional chaining. #463
Comments
I think this is likely related to @babel/parser@7.11.0 which released yesterday |
Here is a repo re-creating this issue: https://github.com/mjhenkes/react-doc-gen-test |
Looks like babel parser estree plugin made a change that is incompatible with ast-types |
You can work around this problem by locking in your babel dependencies in your project's package.json For example: "devDependencies": {
- "@babel/core": "^7.5.0",
+ "@babel/core": "7.10.5",
+ "@babel/parser": "7.10.5", Here's the change we made to our project: |
Update: Babel says it's an intentional change. I've logged an issue to ast-types to add support for the chainExpression type. |
@mjhenkes can you link the issue |
@nafg Sorry, I should have added that to my previous reply. benjamn/ast-types#383 |
On a different note: Should the AST even be handled by |
There isn't any need to use AST-types any more I don't think |
As I can see ast-types released a version to support the new ChainExpression. Should react-docgen update his internal dependency to close the issue? |
+1 for using the new version of ast-types |
@danez it appears that the above referenced PR resolves this issue with the new version of Based on this info, what are the chances we can get a patch or minor version release published since this particular issue is breaking a number of other projects, as seen from incoming references? Also, let me know if there is any way I can assist with this in case there is any work needed to evaluate the version bumps on dependencies to understand what our semantic version should be. |
Hi! When can we expect a new release from |
ping |
Note that you can't fix this in your project without using e.g. |
In case anyone is interested in what this means, in your package.json just add a resolutions key like so
|
bump, @danez when we can expect a release containing this update? |
please share the maintenance burden with more people. many projects rely on this project and folks would be happy to help out. It's totally understandable @danez to not have a ton of time to devote to this project, please enable others to share the burden. |
I just did a release, I can't change the situation, I don't have admin access. |
|
If a component contains optional chaining it will now fail to parse. This used to work.
I'm on version 4.1.1.
Now you get this error:
I kind of suspect this has to do with one of the transitive dependencies more that react-docgen but I'm logging this here first.
How to recreate, run the following test against the below jsx file.
test.js
file.jsx
Also an issue template would help me remember all the things you'd like to see on an issue 😄
The text was updated successfully, but these errors were encountered: