diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,11 @@
 
 # Releases
 
+## Hakyll 4.9.5.0
+
+- Fix compilation issue with `Hakyll.Check` if `checkExternal` is disabled
+  (Fix by Magnus Therning)
+
 ## Hakyll 4.9.4.0
 
 - Make `./site check` concurrent
diff --git a/hakyll.cabal b/hakyll.cabal
--- a/hakyll.cabal
+++ b/hakyll.cabal
@@ -1,5 +1,5 @@
 Name:    hakyll
-Version: 4.9.4.0
+Version: 4.9.5.0
 
 Synopsis: A static website compiler library
 Description:
diff --git a/src/Hakyll/Check.hs b/src/Hakyll/Check.hs
--- a/src/Hakyll/Check.hs
+++ b/src/Hakyll/Check.hs
@@ -8,8 +8,13 @@
 
 
 --------------------------------------------------------------------------------
-import           Control.Monad                (forM_, foldM)
-import           Control.Monad.Reader         (ask, ReaderT, runReaderT)
+import           Control.Concurrent.MVar      (MVar, newEmptyMVar, putMVar,
+                                               readMVar)
+import           Control.Exception            (SomeAsyncException (..),
+                                               SomeException (..), throw, try)
+import           Control.Monad                (foldM, forM_)
+import           Control.Monad.Reader         (ReaderT, ask, runReaderT)
+import           Control.Monad.State          (StateT, get, modify, runStateT)
 import           Control.Monad.Trans          (liftIO)
 import           Control.Monad.Trans.Resource (runResourceT)
 import           Data.ByteString.Char8        (unpack)
@@ -21,16 +26,11 @@
 import           System.Exit                  (ExitCode (..))
 import           System.FilePath              (takeDirectory, takeExtension,
                                                (</>))
-import           Control.Concurrent.MVar      (MVar, newEmptyMVar, putMVar,
-                                               readMVar)
 import qualified Text.HTML.TagSoup            as TS
 
 
 --------------------------------------------------------------------------------
 #ifdef CHECK_EXTERNAL
-import           Control.Exception            (SomeAsyncException (..),
-                                               SomeException (..), try, throw)
-import           Control.Monad.State          (get, modify, StateT, runStateT)
 import           Data.List                    (intercalate)
 import           Data.Typeable                (cast)
 import           Data.Version                 (versionBranch)
@@ -186,7 +186,7 @@
 skip url maybeReason = do
     logger <- checkerLogger <$> ask
     case maybeReason of
-        Nothing -> return ()
+        Nothing     -> return ()
         Just reason -> Logger.debug logger reason
     putCheckResult url mempty {checkerOk = 1}
 
@@ -241,19 +241,14 @@
         Left (SomeException e) ->
             case (cast e :: Maybe SomeAsyncException) of
                 Just ae -> throw ae
-                _ -> faulty url (Just $ showException e)
+                _       -> faulty url (Just $ showException e)
         Right _ -> ok url
     where
         -- Convert exception to a concise form
         showException e = case cast e of
             Just (Http.HttpExceptionRequest _ e') -> show e'
-            _ -> head $ words $ show e
-#else
-checkExternalUrl url = skip url Nothing
-#endif
-
+            _                                     -> head $ words $ show e
 
---------------------------------------------------------------------------------
 requestExternalUrl :: URL -> Checker (Either SomeException Bool)
 requestExternalUrl url = liftIO $ try $ do
     mgr <- Http.newManager Http.tlsManagerSettings
@@ -273,6 +268,9 @@
         -- Nice user agent info
         ua = fromString $ "hakyll-check/" ++
              (intercalate "." $ map show $ versionBranch Paths_hakyll.version)
+#else
+checkExternalUrl url = skip url Nothing
+#endif
 
 
 --------------------------------------------------------------------------------
