diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
 # Changelog
 
+## [0.1.0.3] - 2021-11-05
+
+### Changed
+
+- [#2](https://github.com/dzhus/th-env/pull/2) GHC 9.x / `template-haskell-2.17` support
+
 ## [0.1.0.2] - 2020-06-03
 
 ### Changed
@@ -14,6 +20,7 @@
 
 ## [0.1.0.0] - 2019-05-01
 
+[0.1.0.3]: https://github.com/dzhus/th-env/compare/0.1.0.2...0.1.0.3
 [0.1.0.2]: https://github.com/dzhus/th-env/compare/0.1.0.1...0.1.0.2
 [0.1.0.1]: https://github.com/dzhus/th-env/compare/0.1.0.0...0.1.0.1
 [0.1.0.0]: https://github.com/dzhus/th-env/tree/0.1.0.0
diff --git a/src/Language/Haskell/TH/Env.hs b/src/Language/Haskell/TH/Env.hs
--- a/src/Language/Haskell/TH/Env.hs
+++ b/src/Language/Haskell/TH/Env.hs
@@ -8,6 +8,7 @@
 
 import Data.String
 import Language.Haskell.TH
+import Language.Haskell.TH.Syntax.Compat
 import System.Environment
 
 -- | Produce a typed expression with the current value of an
@@ -15,8 +16,8 @@
 envQ :: IsString a
      => String
      -- ^ Environment variable name.
-     -> TExpQ (Maybe a)
-envQ name =
+     -> SpliceQ (Maybe a)
+envQ name = liftSplice $
   runIO (lookupEnv name) >>= \case
-    Just v  -> [|| Just (fromString v) ||]
-    Nothing -> [|| Nothing ||]
+    Just v  -> fromCode $ toCode [|| Just (fromString v) ||]
+    Nothing -> fromCode $ toCode [|| Nothing ||]
diff --git a/th-env.cabal b/th-env.cabal
--- a/th-env.cabal
+++ b/th-env.cabal
@@ -1,13 +1,13 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.33.0.
+-- This file has been generated from package.yaml by hpack version 0.34.4.
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 76ed87ab6f88fda5e565d31c0e99e3fb972ff35c3ec1163dd76dca3e30284c9d
+-- hash: 77684b3ed7955003a3cc45577f9c5d9f7a3b95b0088f665dba6b29b46eb4a57f
 
 name:           th-env
-version:        0.1.0.2
+version:        0.1.0.3
 synopsis:       Template Haskell splice that expands to an environment variable
 description:    TH splice that expands to an environment variable value. Can be used to embed build-time parameters in your application.
 category:       Template Haskell
@@ -37,6 +37,7 @@
   build-depends:
       base <5
     , template-haskell
+    , th-compat
   default-language: Haskell2010
 
 test-suite readme
