diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
 
 See full history at: <https://github.com/faylang/fay/commits>
 
+#### 0.24.0.2
+
+* Fix dependent compilation fail when building project with stack (#457).
+
 #### 0.24.0.1
 
 * Dependency updates incl GHC 8.4 support
diff --git a/fay.cabal b/fay.cabal
--- a/fay.cabal
+++ b/fay.cabal
@@ -1,5 +1,5 @@
 name:                fay
-version:             0.24.0.1
+version:             0.24.0.2
 synopsis:            A compiler for Fay, a Haskell subset that compiles to JavaScript.
 description:         Fay is a proper subset of Haskell which is type-checked
                      with GHC, and compiled to JavaScript. It is lazy, pure, has a Fay monad,
diff --git a/src/Fay/Compiler/Packages.hs b/src/Fay/Compiler/Packages.hs
--- a/src/Fay/Compiler/Packages.hs
+++ b/src/Fay/Compiler/Packages.hs
@@ -55,12 +55,20 @@
 describePackage :: Maybe FilePath -> String -> IO String
 describePackage db name = do
   exists <- doesFileExist ghc_pkg
-  result <- readAllFromProcess (if exists then ghc_pkg else "ghc-pkg") args ""
+  let command = if exists
+        then if (isInfixOf ".stack" ghc_pkg)
+             then "stack"
+             else ghc_pkg
+        else "ghc-pkg"
+      extraArgs = case command of
+        "stack" -> ["exec","--","ghc-pkg"]
+        _       -> []
+      args = extraArgs ++ ["describe",name] ++ ["--expand-env-vars", "-v2"]
+             ++ ["--package-db=" ++ db' | Just db' <- [db]]
+  result <- readAllFromProcess command args ""
   case result of
     Left  (err,out) -> error $ "ghc-pkg describe error:\n" ++ err ++ "\n" ++ out
     Right (_err,out) -> return out
-
-  where args = ["describe",name] ++ ["-f" ++ db' | Just db' <- [db]]
 
 -- | Get the package version from the package description.
 packageVersion :: String -> Maybe String
diff --git a/src/Fay/Compiler/Typecheck.hs b/src/Fay/Compiler/Typecheck.hs
--- a/src/Fay/Compiler/Typecheck.hs
+++ b/src/Fay/Compiler/Typecheck.hs
@@ -40,10 +40,17 @@
           , "-i" ++ intercalate ":" includeDirs
           , fp ] ++ ghcPackageDbArgs ++ wallF ++ map ("-package " ++) packages
   exists <- doesFileExist GHCPaths.ghc
-  let ghcPath = if exists then GHCPaths.ghc else "ghc"
+  let ghcPath = if exists
+        then if (isInfixOf ".stack" GHCPaths.ghc)
+             then "stack"
+             else GHCPaths.ghc
+        else "ghc"
+      extraFlags = case ghcPath of
+        "stack" -> ["exec","--","ghc"]
+        _       -> []
   when (configShowGhcCalls cfg) $
-    putStrLn . unwords $ ghcPath : flags
-  res <- readAllFromProcess ghcPath flags ""
+    putStrLn . unwords $ ghcPath : (extraFlags ++ flags)
+  res <- readAllFromProcess ghcPath (extraFlags ++ flags) ""
   either (return . Left . GHCError . fst) (return . Right . fst) res
    where
     wallF | configWall cfg = ["-Wall"]
