diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+# 0.5.1.3 (2023-04-23)
+
+* Compatibility with GHC-9.6 / th-abstraction-0.5
+  (thanks to Ryan Scott).
+
 # 0.5.1.2 (2022-01-02)
 
 * Compatibility with GHC-9.2.
diff --git a/generics-sop.cabal b/generics-sop.cabal
--- a/generics-sop.cabal
+++ b/generics-sop.cabal
@@ -1,5 +1,5 @@
 name:                generics-sop
-version:             0.5.1.2
+version:             0.5.1.3
 synopsis:            Generic Programming using True Sums of Products
 description:
   A library to support the definition of generic functions.
@@ -42,7 +42,7 @@
 build-type:          Simple
 cabal-version:       >=1.10
 extra-source-files:  CHANGELOG.md doctest.sh
-tested-with:         GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.2, GHC == 8.10.4, GHC == 9.0.1, GHC == 9.2.1
+tested-with:         GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.4, GHC == 9.6.1
 
 source-repository head
   type:                git
@@ -65,11 +65,11 @@
                        Generics.SOP.NP
                        Generics.SOP.NS
                        Generics.SOP.Sing
-  build-depends:       base                 >= 4.9  && < 4.17,
+  build-depends:       base                 >= 4.9  && < 4.19,
                        sop-core             == 0.5.0.*,
-                       template-haskell     >= 2.8  && < 2.19,
-                       th-abstraction       >= 0.4  && < 0.5,
-                       ghc-prim             >= 0.3  && < 0.9
+                       template-haskell     >= 2.8  && < 2.21,
+                       th-abstraction       >= 0.4  && < 0.6,
+                       ghc-prim             >= 0.3  && < 0.11
   hs-source-dirs:      src
   default-language:    Haskell2010
   ghc-options:         -Wall
diff --git a/src/Generics/SOP/TH.hs b/src/Generics/SOP/TH.hs
--- a/src/Generics/SOP/TH.hs
+++ b/src/Generics/SOP/TH.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE TemplateHaskell #-}
 -- | Generate @generics-sop@ boilerplate instances using Template Haskell.
 module Generics.SOP.TH
@@ -580,8 +581,18 @@
                              , datatypeInstTypes = instTypes
                              , datatypeVariant   = variant
                              , datatypeCons      = cons }) f =
+  checkForTypeData variant $
   f variant ctxt name bndrs instTypes cons
 
+checkForTypeData :: DatatypeVariant -> Q a -> Q a
+checkForTypeData variant q = do
+  case variant of
+#if MIN_VERSION_th_abstraction(0,5,0)
+    TH.TypeData -> fail $ "`type data` declarations not supported"
+#endif
+    _ -> return ()
+  q
+
 checkForGADTs :: TH.ConstructorInfo -> Q a -> Q a
 checkForGADTs (ConstructorInfo { constructorVars    = exVars
                                , constructorContext = exCxt }) q = do
@@ -594,3 +605,6 @@
 isNewtypeVariant DataInstance    = False
 isNewtypeVariant Newtype         = True
 isNewtypeVariant NewtypeInstance = True
+#if MIN_VERSION_th_abstraction(0,5,0)
+isNewtypeVariant TH.TypeData     = False
+#endif
