Solvedts loader Can't use nullish coalescing operator with TypeScript 3.8.2

Expected Behaviour

With TypeScript 3.8.2 I can't use the nullish coalescing operator ?? anymore.

Actual Behaviour

I'm getting the error message

Module parse failed: Unexpected token (36:49)
File was processed with these loaders:
 * ./node_modules/ts-loader/index.js
You may need an additional loader to handle the result of these loaders.

Steps to Reproduce the Problem

Just use const foo = bar ?? '' in your codebase. With TypeScript 3.7.5 everything works fine

17 Answers

✔️Accepted Answer

No. It's not a bug. It's a breaking change in the compiler behavior. I changed the target to es2019 and it's working now.

Other Answers:

Oh, I got it. typescript 3.8 does non transform nullish syntax but webpack's acorn can not parse.
So ts-loader(and webpack) requires es2019 implicitly.

@MadhuvanthG Actually I'm currently in v15.10.0, and I still have the problem.

More Issues: