Closed aargiriou closed 5 years ago
This is the error thrown: Uncaught TypeError: Cannot read property 'toUpperCase' of undefined
Uncaught TypeError: Cannot read property 'toUpperCase' of undefined
It seems that when the navigator.language is something like "el" instead of "el-GR", creates a bug in the method:
let fetchCaniuseBrowserUsage = memoize(() => { const locale = (navigator.languages && navigator.languages[0]) || navigator.language || 'en-US'; const [, countryCode] = locale.split('-'); return fetch(`https://cdn.jsdelivr.net/gh/Fyrd/caniuse/region-usage-json/${countryCode.toUpperCase()}.json`) .then(result => handleFetchErrors(result)) .then(result => result.json()) .then(data => new CaniuseBrowserUsage(data)); });
In file https://github.com/NOtherDev/whatwebcando/blob/master/app/scripts/caniuse.js.
https://github.com/NOtherDev/whatwebcando/blob/master/app/scripts/caniuse.js
Will try to use the "GR" from "el-GR", where in this case it doesn't exist..
Thanks a lot, @anaconda86!
This is the error thrown:
Uncaught TypeError: Cannot read property 'toUpperCase' of undefined
It seems that when the navigator.language is something like "el" instead of "el-GR", creates a bug in the method:
In file
https://github.com/NOtherDev/whatwebcando/blob/master/app/scripts/caniuse.js
.Will try to use the "GR" from "el-GR", where in this case it doesn't exist..