-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
TypeScript syntax error in combination with arrow functions, generics and async/await #6360
Comments
The problem still exists with project generated by 2.1.5, see branch react-scripts-2.1.5 at my repro. I also tested with new project generated by current HEAD 01fbb79 of |
I think this error comes from babel interaction with typescript, since it works OK when using the typescript compiler directly yet it fails when compiling typescript through babel, so I'd also try to post it into the babel repo |
Apparently it got fixed here so it should be fixed by upgrading babel to the latest version |
You can try our latest 3.0 alpha which has updated versions of babel: #6475 |
I can confirm his is no longer an issue with CRA 3.0 (I'm currently using 3.0.1). |
Is this a bug report?
Yes, this is a bug report.
I get a syntax error with the following code, which I reduced as much as possible to just trigger the error:
Did you try recovering your dependencies?
Yes, but recovering didn't help.
Output of
yarn --version
:Environment
Steps to Reproduce
See "Reproducible Demo".
Expected Behavior
I wouldn't expect a syntax error (other errors with this code, yes, but no syntax error)
AFAIK the code is valid TypeScript.
Actual Behavior
Syntax error:
As colorized screenshot:
Reproducible Demo
Reproducible repo at https://github.com/sbusch/2019-02-08-cra-ts-syntaxerror which I stripped down as much as possible.
Problem is in
src/index.tsx
:Steps to reproduce:
git clone https://github.com/sbusch/2019-02-08-cra-ts-syntaxerror.git cd 2019-02-08-cra-ts-syntaxerror yarn install BROWSER=none yarn start
The text was updated successfully, but these errors were encountered: