Update Babel to support new TypeScript 3.7.2 syntax features
See original GitHub issueIs your proposal related to a problem?
When updating my projects TypeScript version to the new 3.7.2 and trying to use the new syntax, such as optional chaining:
foo?.bar()
I get an error during runtime saying that Babel does not support this feature:
Support for the experimental syntax ‘optionalChaining’ isn’t currently enabled Add @babel/plugin-proposal-optional-chaining (https://git.io/vb4Sk) to the ‘plugins’ section of your Babel config to enable transformation.
Describe the solution you’d like
It would be nice if the Babel config made by CRA would install these new features. I do not want to have to eject to customize my Babel config.
Describe alternatives you’ve considered
I’ve tried installing the Babel plugin as described here with no luck: https://babeljs.io/docs/en/babel-plugin-proposal-nullish-coalescing-operator
Issue Analytics
- State:
- Created 4 years ago
- Reactions:32
- Comments:7 (1 by maintainers)
Top Results From Across the Web
7.7.0 Released: Error recovery and TypeScript 3.7 - Babel.js
Today we are releasing Babel 7.7.0! This release includes new parser features like top-level await ( await x() , Stage 3) and Flow...
Read more >Documentation - TypeScript 3.7
Nullish Coalescing. Playground. The nullish coalescing operator is another upcoming ECMAScript feature that goes hand-in-hand with optional chaining, and which ...
Read more >TypeScript 3.7.2 - Support for the experimental syntax ...
I am wondering if I need babel plugin & config when I am using TS already, and how should I fix the error?...
Read more >Changelog | Meteor API Docs
updated Typescript deps and meteor babel. ... Updated babel to 7.17.1. ... in your mongouri to avoid the new mongo driver Service Discovery...
Read more >TypeScript and Babel 7 - Microsoft Developer Blogs
While Babel can take over compiling/transpiling – doing things like erasing your types and rewriting the newest ECMAScript features to work in ...
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 FreeTop 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
Top GitHub Comments
I’m still waiting for a CRA release to start using TS 3.7 for all our projects (monorepo).
Dupe of #7431. We’ll be releasing support in the next few days.