import { IConfig } from "@cfg/index.d";

export const loadConfig = (url: string): Promise<IConfig<any>> =>
  new Promise((resolve, reject) => {
    fetch(url)
      .then(res => res.json())
      .catch(reject)
      .then(parsedConfig => {
        resolve(parsedConfig);
      });
  });

import { IConfig } from "@cfg/index.d";

export const loadConfig = (url: string): Promise<IConfig<any>> =>
  new Promise((resolve, reject) => {
    fetch(url)
      .then(res => res.json())
      .then(parsedConfig => {
        resolve(parsedConfig);
      })
      .catch(reject);
  });

--- 
+++ 
@@ -4,8 +4,8 @@
   new Promise((resolve, reject) => {
     fetch(url)
       .then(res => res.json())
+      .catch(reject)
       .then(parsedConfig => {
         resolve(parsedConfig);
-      })
-      .catch(reject);
+      });
   });
Fix runtime config loader example promise rejection being called too late
