-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Strange SyntaxError when running tests, probably transpiler bug #3055
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
Comments
Ping |
Still have this error. |
Sorry, we were busy with releasing React 16 and this project did not receive much attention at the time. |
I can reproduce this. But I don't know if it's a bug with Babel or something else. The minimal example is: const x = async (
x: A
) => {
const text = await x;
}; Interestingly, removing newlines around the argument list fixes it. |
I think the next step here is to create a minimal reproducing example with Babel and without CRA. |
This appears fixed in Babel 7 and doesn't happen in our |
I'm adding a regression test in #3791 so this doesn't break again. |
Is this a bug report?
Yes.
Can you also reproduce the problem with npm 4.x?
I'm using yarn. Tried npm 4 though. Same.
Which terms did you search for in User Guide?
Did a quick look-through. I searched google for
SyntaxError: Unexpected identifier
, did not found the solution.Environment
node -v
: v8.4.0npm -v
: 4.6.1 (was 5.x before)yarn --version
:0.27.5
npm ls react-scripts
:[email protected]
(also checked at[email protected]
with yarn)Switching yarn/npm seems to have no effect.
Then, specify:
Steps to Reproduce
The issue is really strange.
Create a new project,
cd
into it.yarn add flow-bin
([email protected]
), thenyarn flow init
.Create two files:
src/dummy.js
src/dummy.test.js
yarn test
Expected Behavior
Tests run successfully or at least fail with some sane error.
Actual Behavior
Seems to be related to the way code is formatted. 😮
Reproducible Demo
https://github.com/MOZGIII/js-bug-demo-1
Just cone it and
yarn install
.Run
CI=true yarn test
. Pretend you're CI to run all tests.The text was updated successfully, but these errors were encountered: