Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upStandard cannot parse React JSX files #1359
Comments
evantahler
changed the title
Standard cannot parse React files
Standard cannot parse React JSX files
Aug 14, 2019
This comment has been minimized.
This comment has been minimized.
|
I cannot reproduce this issue. Indeed, the demo site shows it works just fine: https://standardjs.com/demo.html?gist=ff5832e447327defb72164f9e245bd4a My guess is that you're pulling in an old version of standard (perhaps install globally?) Can you share the output of these commands, run from your project folder:
Thanks! |
feross
added
the
need more info
label
Aug 14, 2019
This comment has been minimized.
This comment has been minimized.
|
First off, that demo site using a Gist is awesome! I created a small demo project that uses Next.JS, Jest and Standard... and it works fine. There must be something else in my main project getting in the way... sorry to bother you! Example Project: https://github.com/evantahler/react-next-standard-test |
evantahler
closed this
Aug 14, 2019
This comment has been minimized.
This comment has been minimized.
|
Weirdly, I just ran into this issue on one my sites. Here's the build failure: https://travis-ci.org/feross/play.cash/builds/572130278?utm_source=github_status&utm_medium=notification @evantahler Did you ever figure out the cause? Downgrading to standard@12 fixes the issue for me. |
This comment has been minimized.
This comment has been minimized.
|
Oh sheesh, it's a bug in
It looks like this is a workaround: Related issues: |
This comment has been minimized.
This comment has been minimized.
|
I'll take your word for it |
feross
added a commit
to feross/play.cash
that referenced
this issue
Aug 15, 2019
This comment has been minimized.
This comment has been minimized.
|
@feross Yes! That's great detective work. I had an old version of Acorn in some projects, and I started re-installing deps 1-by-1 until it worked... and the working build lacks a top-level acorn requirement. |
ljharb
added a commit
to airbnb/react-dates
that referenced
this issue
Aug 16, 2019
feross
added a commit
to feross/safe-buffer
that referenced
this issue
Aug 19, 2019
This comment has been minimized.
This comment has been minimized.
|
It looks like for some projects, this is still a problem (see this upgrade and test suite) actionhero/www.actionherojs.com#63. |
evantahler commentedAug 14, 2019
What version of this package are you using?
13.1.0
What operating system, Node.js, and npm version?
Node v12
OSX (latest)
What happened?
Take a simple react JSX file (from: https://reactjs.org/docs/hooks-intro.html)
However, Standard cannot parse the file and thinks the
{is not valid JSX:This seems to be a new type of bug.
What did you expect to happen?
Valid JS and Standard not to crash
Are you willing to submit a pull request to fix this bug?
Sure!