plausible / analytics

Simple, open source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.
https://plausible.io
GNU Affero General Public License v3.0
20.38k stars 1.09k forks source link

TypeError: c is undefined / TypeError: Cannot read property 'properties' of undefined #506

Closed velut closed 3 years ago

velut commented 3 years ago

Prerequisites

Bug report

Describe the bug

On plausible.io, when clicking on "Singapore" from the "Top Countries" modal or when visiting https://plausible.io/jsdocs.io?country=SGP an error page comes up with the error "TypeError: c is undefined" on Firefox and "TypeError: Cannot read property 'properties' of undefined" on Chrome.

Expected behavior The page loads like for other countries.

Environment (If applicable):

metmarkosaric commented 3 years ago

Same issue on our live demo! https://plausible.io/plausible.io?period=day&country=SGP

Thanks for reporting this @velut!

Vigasaurus commented 3 years ago

This seems to be because the DataMaps library doesn't have a provision for Singapore in its world map. Kinda weird, but should just need a fallback to prevent this error and nothing more.