diff --git a/lib/datasource/hex/index.ts b/lib/datasource/hex/index.ts
index 5d812d8dbd6a8ebca0b5d1341c3207467732417c..6c197eb05fa34fa80d11e8f0000b38dd8ace3d09 100644
--- a/lib/datasource/hex/index.ts
+++ b/lib/datasource/hex/index.ts
@@ -27,6 +27,11 @@ export class HexDatasource extends Datasource {
     lookupName,
     registryUrl,
   }: GetReleasesConfig): Promise<ReleaseResult | null> {
+    // istanbul ignore if
+    if (!registryUrl) {
+      return null;
+    }
+
     // Get dependency name from lookupName.
     // If the dependency is private lookupName contains organization name as following:
     // hexPackageName:organizationName
@@ -75,7 +80,7 @@ export class HexDatasource extends Datasource {
     }
 
     if (meta?.links?.Github) {
-      result.sourceUrl = hexRelease.meta.links.Github;
+      result.sourceUrl = meta?.links?.Github;
     }
 
     return result;
diff --git a/tsconfig.strict.json b/tsconfig.strict.json
index fe2af8a5e108838c921e76816fc926f1abc90c78..0a075968b4da18cb931120e3742ffc0648a28f2c 100644
--- a/tsconfig.strict.json
+++ b/tsconfig.strict.json
@@ -19,6 +19,7 @@
     "lib/datasource/dart",
     "lib/datasource/gitlab-tags/util.ts",
     "lib/datasource/helm/common.ts",
+    "lib/datasource/hex",
     "lib/datasource/metadata.ts",
     "lib/datasource/sbt-plugin/util.ts",
     "lib/globals.d.ts",
@@ -81,6 +82,7 @@
     "lib/datasource/go/common.ts",
     "lib/datasource/go/types.ts",
     "lib/datasource/helm/common.ts",
+    "lib/datasource/hex/**/*.spec.ts",
     "lib/logger/err-serializer.spec.ts",
     "lib/util/cache/**/*.spec.ts",
     "lib/util/exec/buildpack.spec.ts",