Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

lookup does not work when db is not present

Blue Mouse2e2332470adf
diff --git a/apps/production/src/common/utils.ts b/apps/production/src/common/utils.ts
index dff1bd694..bd605fb3d 100644
--- a/apps/production/src/common/utils.ts
+++ b/apps/production/src/common/utils.ts
@@ -136,18 +136,18 @@ const generateRandomString = (length: number): string =>
const dummyLookup = () => ({
country: {
names: {
- en: 'NULL',
+ en: null,
},
},
city: {
names: {
- en: 'NULL',
+ en: null,
},
},
subdivisions: [
{
names: {
- en: 'NULL',
+ en: null,
},
},
],
@@ -160,9 +160,11 @@ const PRODUCTION_GEOIP_DB_PATH = path.join(
'dbip-city-lite.mmdb',
)
-// @ts-ignore
// eslint-disable-next-line
-let lookup: Reader<CityResponse> = dummyLookup
+let lookup: Reader<CityResponse> = {
+ // @ts-ignore
+ get: dummyLookup,
+}
if (fs.existsSync(PRODUCTION_GEOIP_DB_PATH)) {
const buffer = fs.readFileSync(PRODUCTION_GEOIP_DB_PATH)