upgrading to react-script 3.3.1 breaks optional chaining
See original GitHub issueSince upgrading to react-scripts 3.3.1 my code, which uses optional chaining, fails to compile.
Module parse failed: Unexpected token (22:12)
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
* ./node_modules/eslint-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
| // library barfs if you have an undefined value here instead of an empty array
|
> if (props?.SelectProps?.multiple && field.value === undefined) {
| field.value = [];
Issue Analytics
- State:
- Created 4 years ago
- Reactions:23
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Enabling optional chaining in a create-react-app
In this post, we'll learn how to enable optional chaining in an ... Use create-react-app version 3.3.0 or upgrade to react-scripts 3.3.0 or...
Read more >Using Optional Chaining?. With Cra/Reactscripts - ADocLib
UPD3 fix for optional chaining landed into acorn 7.3.0 but [email protected] uses acorn 6.x. so upgrading to reactscript 3.3.1 breaks optional chaining....
Read more >Optional-Chaining does not work in create-react-app
I noticed that if i upgrade react-scripts to 4+ optional chaining didnt work in my app, if i brought it down to 3.x.x...
Read more >create-react-app 3.3.0 released! Support for optional chaining ...
I reckon I could run a global replace and nothing will break. Javascript needed nullish coalescing so bad.
Read more >Third-party software dependencies | Elastic Cloud Enterprise ...
Library Version Optional/Required Packaged
akka‑actor_2.12 2.6.18 Required Yes
akka‑http‑core_2.12 10.2.7 Required Yes
akka‑http‑json4s_2.12 1.27.0 Required Yes
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This issue is still present on 3.4.0.
@ggascoigne I encountered the same problem when upgrading to 3.3.1. I was able to resolve the issue and stay on 3.3.1 by deleting my node_modules folder and reinstalling my dependencies.
I don’t understand the underlying issue but sharing this info in case it helps others.