diff --git a/aeson.cabal b/aeson.cabal
--- a/aeson.cabal
+++ b/aeson.cabal
@@ -1,5 +1,5 @@
 name:               aeson
-version:            2.1.2.0
+version:            2.1.2.1
 license:            BSD3
 license-file:       LICENSE
 category:           Text, Web, JSON
@@ -18,7 +18,7 @@
    || ==8.8.4
    || ==8.10.7
    || ==9.0.2
-   || ==9.2.6
+   || ==9.2.7
    || ==9.4.4
 
 synopsis:           Fast JSON parsing and encoding
@@ -131,14 +131,14 @@
     , hashable              >=1.3.5.0  && <1.5
     , indexed-traversable   >=0.1.2    && <0.2
     , OneTuple              >=0.3.1    && <0.4
-    , primitive             >=0.7.3.0  && <0.8
+    , primitive             >=0.7.3.0  && <0.9
     , QuickCheck            >=2.14.2   && <2.15
     , scientific            >=0.3.7.0  && <0.4
     , semialign             >=1.2      && <1.3
     , strict                >=0.4      && <0.5
     , tagged                >=0.8.6    && <0.9
     , text-short            >=0.1.5    && <0.2
-    , th-abstraction        >=0.3.0.0  && <0.5
+    , th-abstraction        >=0.3.0.0  && <0.6
     , these                 >=1.1.1.1  && <1.2
     , unordered-containers  >=0.2.10.0 && <0.3
     , uuid-types            >=1.0.5    && <1.1
@@ -215,7 +215,7 @@
     , OneTuple
     , primitive
     , QuickCheck            >=2.14.2   && <2.15
-    , quickcheck-instances  >=0.3.26.1 && <0.4
+    , quickcheck-instances  >=0.3.29   && <0.4
     , scientific
     , strict
     , tagged
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,9 @@
 For the latest version of this document, please see [https://github.com/haskell/aeson/blob/master/changelog.md](https://github.com/haskell/aeson/blob/master/changelog.md).
 
+### 2.1.2.1
+
+* Support `th-abstraction-0.5`
+
 ### 2.1.2.0
 
 * Add `throwDecode :: (MonadThrow m, FromJSON a) => ByteString -> m a`
diff --git a/src/Data/Aeson/TH.hs b/src/Data/Aeson/TH.hs
--- a/src/Data/Aeson/TH.hs
+++ b/src/Data/Aeson/TH.hs
@@ -138,7 +138,7 @@
 import qualified Data.Monoid as Monoid
 import Data.Set (Set)
 import Language.Haskell.TH hiding (Arity)
-import Language.Haskell.TH.Datatype
+import Language.Haskell.TH.Datatype as Datatype
 #if MIN_VERSION_template_haskell(2,8,0) && !(MIN_VERSION_template_haskell(2,10,0))
 import Language.Haskell.TH.Syntax (mkNameG_tc)
 #endif
@@ -1456,6 +1456,9 @@
                          Newtype         -> False
                          DataInstance    -> True
                          NewtypeInstance -> True
+#if MIN_VERSION_th_abstraction(0,5,0)
+                         Datatype.TypeData -> False
+#endif
 
         remainingTysOrigSubst' :: [Type]
         -- See Note [Kind signatures in derived instances] for an explanation
