I was using esnext so that wasn't going to work. Built-In Type Declarations in TypeScript - Marius Schulz While TypeScript will support the feature and add polyfills for it soon. Installation npm install --save-dev @babel/plugin-syntax-optional-chaining The optional chaining ?. As stated in the Conclusion section on MDN (Inheritance & prototype chain) Instead, if you use a modern framework, you can simply include it at the root of your project or store it in a global namespaced object. loose. In addition, to reduce bundle size, Next.js will only load these polyfills for browsers that require them. GitHub is broken because of optional chaining (?.) Putting Them Together. GitHub - tc39/proposal-optional-chaining But We will need to babel it for a very long time. . after optional chaining to provide a default value. Vue-cli 3, babel polyfills and IE11 - Get Help - Vue Forum If you take a look at @babel/plugin-proposal-optional-chaining, this is how babel will transpile it. The optional chaining ?. Described here is a step ahead, over this, on how to replace a specific if..else chaining with an elegant looking block using Optionals. This is kind of a very verbose output. // babel.config.json { "assumptions": { "noDocumentAll": true } } in your chain. 今回紹介したES2020の新機能のうち、個人的にはOptional Chaining、Nullish coalescing Operator、import()、Promise.allSettled()がとても便利に感じます。新機能はこれまで面倒だった処理を簡潔にしてくれる効果があるので、積極的にキャッチアップしていきましょう。 I played around and experimented with a few different solutions but I couldn't get it to work. 08 - Maps. For more advanced configurations . I added a .babelrc to the .storybook directory, installed babel-plugin-transform-optional-chaining, and added this to the .babelrc. targets. In the above statement, we combined the use of optional chaining and nullish coalescing to achieve the same result that we were getting by using lodash or making the use of && and || operators. V8's V8: Optional Chaining and Nullish Coalescing in JavaScript mentioned this issue. So you can . 53. Optional chaining As such there is nothing wrong with optional chaining. I tried with @vue/app and @vue/cli-plugin-babel/preset but IE is keeps throwing me: And if I inject the Object Assign polyfill directly into the html, it's failing in another one so clearly the polyfills written in the config file are not being included. is undefined or null and returns undefined.