t-animal/covid-karte

Website broken on Microsoft Edge for Android

Akkjon opened this issue · 3 comments

The website does not load any data on Android.

It logs the following error to the console: "Uncaught SyntaxError: Unexpected token '?' "county-information.js:1
The line corrosponding to that error: "l(t ?? null)" (formated: line 6)

Edge mobile does not yet support the Nullish coalescing operator.

image

And why is it there anyways? Do I miss something, because it would return null if t is null or undefined... so it doesn't change something, wether just "t" is used, or "t ?? null"

I would love to fix this, but in the foreseeable future this won't happen. The problem is that snowpack doesn't use a real typescript compiler, but esbuild. And esbuild basically just strips the type information, whereas tsc would compile the operator to backward compatible javascript. Unfortunately I didn't know this when setting up the project and I wanted to try out snowpack. Now, I thought I could just update snowpack and maybe get a newer version of esbuild and maybe they did something to improve typescript compilation. But I also want to update to chart.js 3 and that's not correctly built with current snowpack. So, because of that I can't simply update all my dependencies and that probably would not even have fixed the problem.

As this is a hobby project I don't wanna spend too much time to support a fringe browser. As for your question why it's there: The answer is that null !== undefined and t??null makes sure that the called function receives null, whereas the function that returns t returns undefined if the data is missing.

Who tf uses Microsoft Edge anyway?
Maybe on Windows because it's preinstalled...
but on Android?