Optional Chaining

After setting the node version to greater than 14, I am still getting Unexpected token errors when using ?.. Optional chaining was added to node in version 14, so it should work.

Hi @croolsby, without going into a ton of detail, we’re currently limited by the version of Babel we use, so even though the underlying Node does support it, Babel sits in between and disallows it. We are as we speak working on fixing this. That being said, you can use optional chaining in any packages you require on RunKit, as well as in eval (since that circumvents Babel): RunKit

Hi, optional chaining is built-in to Node >= 14 and even modern browsers. It does not require babel.

Hi @croolsby, I am well aware that it is built in to Node 14, that is how it is possible for it to work in required packages and eval, I was not suggesting that we had somehow made it work for eval-ed strings and were saving normal code for last. We use Babel for a different step in the pipeline and it unfortunately has the side-effect of throwing this error because it does not recognize that syntax. As I stated, we are actively working on fixing this.

Hi, still not working in August 22 :slightly_smiling_face: I’m using Node v18.5.0 in RunKit.

1 Like

October 17th, 2022. Still not there?

(Two years pass)
<snark>
and how long do such bugs take to fix when they’re not being actively worked on
</snark>