Nullish coalescing assignment (??=) causing issue on TV browser. How to elegantly resolve this

72 views Asked by At

I am running an Angular (v17) app for our product which is also used on TV's by our customer. When migrating from our React app to a brand new Angular app, we got these Nullish coalescing assignment (??=) errors on the TV. I resolved it by using a .browserslistrc file and locking in version 12 of Safari, because that build was the only build that didn't add operators that TV browsers don't accept. This fixed worked, but I was going 4 versions back from latest (at the time 16) but now Safari moved to version 17 so my browserlist version of Safari is now 13 which includes those operators again. And the App breaks on the TV.

That is the introduction. My question is, besides locking browserlist to Safari 12, is there another better way of having Angular build without the operators that break. If I remember, it is not the only operator (??=) that breaks but I don't know for sure.

I tried altering my ts-config with different targets but that didn't work. Using the browserlist Safari 12 approach was the only thing that for babel/esbuild (not sure which) to build in a way that is acceptable for most TV Browsers.

Is there a better way to do this?

0

There are 0 answers