diff --git a/CHANGES.md b/CHANGES.md
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -22,7 +22,12 @@
 For user-visible changes, see the hledger package changelog.
 
 
-# 2025-03-12 1.42.1
+# 1.42.2 2025-05-16
+
+- Require extra >= 1.7.11, fixing the stack8.10.yaml build. (Thomas Miedema)
+
+
+# 1.42.1 2025-03-12
 
 
 # 1.42 2025-03-07
diff --git a/Hledger/Utils/IO.hs b/Hledger/Utils/IO.hs
--- a/Hledger/Utils/IO.hs
+++ b/Hledger/Utils/IO.hs
@@ -318,8 +318,8 @@
   (r, w) <- createPipe
   hSetEncoding r utf8_bom
   hSetEncoding w utf8_bom
-  T.hPutStr w t
-  hClose w
+  -- use a separate thread so that we don't deadlock if we can't write all of the text at once
+  forkIO $ T.hPutStr w t >> hClose w
   return r
 
 -- | Like embedFile, but takes a path relative to the package directory.
diff --git a/hledger-lib.cabal b/hledger-lib.cabal
--- a/hledger-lib.cabal
+++ b/hledger-lib.cabal
@@ -1,11 +1,11 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.37.0.
+-- This file has been generated from package.yaml by hpack version 0.38.0.
 --
 -- see: https://github.com/sol/hpack
 
 name:           hledger-lib
-version:        1.42.1
+version:        1.42.2
 synopsis:       A library providing the core functionality of hledger
 description:    This library contains hledger's core functionality.
                 It is used by most hledger* packages so that they support the same
@@ -142,7 +142,7 @@
     , directory >=1.2.6.1
     , doclayout >=0.3 && <0.6
     , encoding >=0.10
-    , extra >=1.6.3
+    , extra >=1.7.11
     , file-embed >=0.0.10
     , filepath
     , hashtables >=1.2.3.1
@@ -202,7 +202,7 @@
     , doclayout >=0.3 && <0.6
     , doctest >=0.18.1
     , encoding >=0.10
-    , extra >=1.6.3
+    , extra >=1.7.11
     , file-embed >=0.0.10
     , filepath
     , hashtables >=1.2.3.1
@@ -263,7 +263,7 @@
     , directory >=1.2.6.1
     , doclayout >=0.3 && <0.6
     , encoding >=0.10
-    , extra >=1.6.3
+    , extra >=1.7.11
     , file-embed >=0.0.10
     , filepath
     , hashtables >=1.2.3.1
