diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # Changelog for yesod-fay
 
+## 0.10.0
+
+* Support for compilation with stack [#22](https://github.com/fpco/yesod-fay/issues/22)
+
 ## 0.9.0
 
 * Support for Yesod 1.6 [#20](https://github.com/fpco/yesod-fay/issues/20)
diff --git a/Yesod/Fay.hs b/Yesod/Fay.hs
--- a/Yesod/Fay.hs
+++ b/Yesod/Fay.hs
@@ -94,7 +94,7 @@
 import           Data.Default               (def)
 #endif
 import           Data.Digest.Pure.MD5       (md5)
-import           Data.List                  (isPrefixOf)
+import           Data.List                  (isPrefixOf, isInfixOf)
 import           Data.Maybe                 (isNothing)
 import           Data.Monoid                ((<>), mempty)
 import           Data.Text                  (pack, unpack)
@@ -140,7 +140,7 @@
 import           Control.Exception (IOException,catch)
 import           Prelude hiding (catch)
 import           System.Directory
-import           System.Environment         (getEnvironment)
+import           System.Environment         (lookupEnv)
 import           Text.Julius                (Javascript (Javascript), julius)
 import           Yesod.Core
 import           Yesod.Fay.Data
@@ -229,7 +229,7 @@
 
 -- | Read runtime from default Fay config.
 getRuntime :: IO L.ByteString
-getRuntime = readConfigRuntime defaultConfig >>= return . LC.pack
+getRuntime = readConfigRuntime config >>= return . LC.pack
 
 updateRuntime :: FilePath -> IO ()
 updateRuntime fp = getRuntime >>= \js ->
@@ -318,9 +318,13 @@
   case result of
     Right cache -> return (Right cache)
     Left refreshTo -> do
-      packageConf <- fmap (lookup "HASKELL_PACKAGE_SANDBOX") getEnvironment
-      result <- compile conf {configPackageConf = packageConf}
-                        fp
+      sandboxPackageConf <- lookupEnv "HASKELL_PACKAGE_SANDBOX"
+      let packageConf = case sandboxPackageConf of
+            Nothing -> Nothing
+            Just sandbox -> if isInfixOf ".stack" sandbox
+              then Nothing
+              else sandboxPackageConf
+      result <- compile (conf {configPackageConf = packageConf}) fp
       case result of
         Left e -> return (Left e)
         Right (sourceAndFiles -> (source',files)) -> do
diff --git a/yesod-fay.cabal b/yesod-fay.cabal
--- a/yesod-fay.cabal
+++ b/yesod-fay.cabal
@@ -1,5 +1,5 @@
 name:                yesod-fay
-version:             0.9.0
+version:             0.10.0
 synopsis:            Utilities for using the Fay Haskell-to-JS compiler with Yesod.
 description:         For initial discussion, see <http://www.yesodweb.com/blog/2012/10/yesod-fay-js>. This is a work-in-progress.
 homepage:            https://github.com/fpco/yesod-fay
@@ -17,7 +17,7 @@
                        Fay.Yesod
   other-modules:       Yesod.Fay.Data
   build-depends:       base >= 4 && < 5
-                     , fay >= 0.21.2.1
+                     , fay >= 0.24
                      , fay-dom >= 0.5
                      , transformers >= 0.2
                      , aeson >= 0.6
