-
-
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
Parsing errors when upgrading to react-scripts 4.0.1 #10212
Comments
Deleting the .eslintrc.js file in the project root solved the issue for me. |
Seems to have solved the issue ! Thanks ! |
+same, no .eslintrc.js, not ejected... any help? |
applying fix in #9791 solved this for me - thank you @pluma! good general technique to remember here: spin up a new CRA and compare the broken proj to see if there's anything new required in base configs like package.json... i've seen react-scripts validate tsconfig.json so it seems like they could include these kinds of checks as well??
|
I came across this when trying to upgrade my company's create-react-app from v3→v4. The migration path doesn't note that you will lose ESLint capabilities unless you specify `eslintConfig` explicitly in your `package.json` going forward. Progression of ESLint changes in Webpack: - removal of original extend and addition to `template.json`: https://github.com/facebook/create-react-app/pull/9587/files - referencing of /base instead of /index: https://github.com/facebook/create-react-app/pull/9640/files#diff-8e25c4f6f592c1fcfc38f0d43d62cbd68399f44f494c1b60f0cf9ccd7344d697R366 This was also noticed by other developers in these bugs: facebook#9791 facebook#10212
Describe the bug
Getting a lot of "Parsing Error: Unexpected Token" when upgrading from react-scripts 3.4.4 to 4.0.1
Did you try recovering your dependencies?
Yes
Environment
System:
OS: Windows 10 10.0.18363
CPU: (16) x64 Intel(R) Xeon(R) W-2145 CPU @ 3.70GHz
Binaries:
Node: 10.21.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 87.0.4280.88
Edge: Spartan (44.18362.449.0)
Internet Explorer: 11.0.18362.1
npmPackages:
react: ^17.0.1 => 17.0.1
react-dom: ^17.0.1 => 17.0.1
react-scripts: ^4.0.1 => 4.0.1
npmGlobalPackages:
create-react-app: Not Found
Context
I had an application using react 16, typescript 3 and react-scripts 3.
I upgraded all of my packages except react-scripts => everything is working fine.
Upgraded react-scripts to 4.0.1 and now I got multiple "Parsing Error: Unexpected token"
for example :
src\Model\Job.tsx
Line 100:39: Parsing error: Unexpected token, expected ","
98 |
99 | function getStartTime(span: HoursTimespan): moment.Moment {
src\components\ActiveJobs.tsx
Line 65:27: Parsing error: Unexpected token
63 | return (
64 |
Tell me if you need more information :)
Thank you!
The text was updated successfully, but these errors were encountered: