diff --git a/composite-aeson.cabal b/composite-aeson.cabal
--- a/composite-aeson.cabal
+++ b/composite-aeson.cabal
@@ -1,9 +1,11 @@
--- This file has been generated from package.yaml by hpack version 0.18.1.
+-- This file has been generated from package.yaml by hpack version 0.20.0.
 --
 -- see: https://github.com/sol/hpack
+--
+-- hash: e5cf48f0def6a0629ab84aeef3ea62b238fbc13d5a79a01f1bd4ebbdccf3df5f
 
 name:           composite-aeson
-version:        0.5.3.0
+version:        0.5.4.0
 synopsis:       JSON for Vinyl/Frames records
 description:    Integration between Aeson and Vinyl/Frames records allowing records to be easily converted to JSON using automatic derivation, explicit formats, or a mix of both.
 category:       Records
@@ -21,27 +23,26 @@
   default-extensions: DataKinds FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving LambdaCase MultiParamTypeClasses MultiWayIf OverloadedStrings PatternSynonyms PolyKinds QuasiQuotes RankNTypes ScopedTypeVariables StandaloneDeriving StrictData TemplateHaskell TupleSections TypeApplications TypeFamilies TypeOperators ViewPatterns
   ghc-options: -Wall -O2
   build-depends:
-      base >= 4.7 && < 5
-    , mtl
-    , aeson
-    , aeson-better-errors
-    , composite-base
-    , containers
-    , contravariant
-    , generic-deriving
-    , hashable
-    , lens
-    , mmorph
-    , mtl
-    , profunctors
-    , scientific
-    , tagged
-    , template-haskell
-    , text
-    , time
-    , unordered-containers
-    , vector
-    , vinyl
+      aeson >=1.1.2.0 && <1.3
+    , aeson-better-errors >=0.9.1.0 && <0.10
+    , base >=4.7 && <5
+    , composite-base >=0.5.3.0 && <0.6
+    , containers >=0.5.7.0 && <0.6
+    , contravariant >=1.4 && <1.5
+    , generic-deriving >=1.11.2 && <1.13
+    , hashable >=1.2.6.1 && <1.3
+    , lens >=4.15.4 && <4.17
+    , mmorph >=1.0.9 && <1.2
+    , mtl >=2.2.1 && <2.3
+    , profunctors >=5.2.1 && <5.3
+    , scientific >=0.3.5.1 && <0.4
+    , tagged >=0.8.5 && <0.9
+    , template-haskell >=2.11.1.0 && <2.13
+    , text >=1.2.2.2 && <1.3
+    , time >=1.6.0.1 && <1.9
+    , unordered-containers >=0.2.8.0 && <0.3
+    , vector >=0.12.0.1 && <0.13
+    , vinyl >=0.5.3 && <0.8
   exposed-modules:
       Composite.Aeson
       Composite.Aeson.Base
@@ -67,31 +68,30 @@
   default-extensions: DataKinds FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving LambdaCase MultiParamTypeClasses MultiWayIf OverloadedStrings PatternSynonyms PolyKinds QuasiQuotes RankNTypes ScopedTypeVariables StandaloneDeriving StrictData TemplateHaskell TupleSections TypeApplications TypeFamilies TypeOperators ViewPatterns
   ghc-options: -Wall -O2 -threaded -rtsopts -with-rtsopts=-N -fno-warn-orphans
   build-depends:
-      base >= 4.7 && < 5
-    , mtl
-    , aeson
-    , aeson-better-errors
-    , composite-base
-    , containers
-    , contravariant
-    , generic-deriving
-    , hashable
-    , lens
-    , mmorph
-    , mtl
-    , profunctors
-    , scientific
-    , tagged
-    , template-haskell
-    , text
-    , time
-    , unordered-containers
-    , vector
-    , vinyl
-    , QuickCheck
+      QuickCheck
+    , aeson >=1.1.2.0 && <1.3
+    , aeson-better-errors >=0.9.1.0 && <0.10
     , aeson-qq
+    , base >=4.7 && <5
     , composite-aeson
+    , composite-base >=0.5.3.0 && <0.6
+    , containers >=0.5.7.0 && <0.6
+    , contravariant >=1.4 && <1.5
+    , generic-deriving >=1.11.2 && <1.13
+    , hashable >=1.2.6.1 && <1.3
     , hspec
+    , lens >=4.15.4 && <4.17
+    , mmorph >=1.0.9 && <1.2
+    , mtl >=2.2.1 && <2.3
+    , profunctors >=5.2.1 && <5.3
+    , scientific >=0.3.5.1 && <0.4
+    , tagged >=0.8.5 && <0.9
+    , template-haskell >=2.11.1.0 && <2.13
+    , text >=1.2.2.2 && <1.3
+    , time >=1.6.0.1 && <1.9
+    , unordered-containers >=0.2.8.0 && <0.3
+    , vector >=0.12.0.1 && <0.13
+    , vinyl >=0.5.3 && <0.8
   other-modules:
       DateTimeSpec
       EnumSpec
@@ -99,4 +99,5 @@
       RecordSpec
       THSpec
       TupleSpec
+      Paths_composite_aeson
   default-language: Haskell2010
diff --git a/src/Composite/Aeson/CoRecord.hs b/src/Composite/Aeson/CoRecord.hs
--- a/src/Composite/Aeson/CoRecord.hs
+++ b/src/Composite/Aeson/CoRecord.hs
@@ -32,7 +32,7 @@
 instance forall s a rs. (DefaultJsonFormat a, DefaultJsonFormatField rs) => DefaultJsonFormatField (s :-> a ': rs) where
   defaultJsonFormatField = wrappedJsonFormat defaultJsonFormat :& (defaultJsonFormatField :: JsonFormatField e rs)
 
--- |Make a @'JsonFormat' e (Field rs)@ given how to map the sum type to JSON alogn with a record with formatters for each value the field could have.
+-- |Make a @'JsonFormat' e (Field rs)@ given how to map the sum type to JSON along with a record with formatters for each value the field could have.
 fieldJsonFormat
   :: forall (rs :: [*]) r' (rs' :: [*]) e.
      (rs ~ (r' ': rs'), RecApplicative rs, RecWithContext rs rs, ReifyNames rs)
diff --git a/src/Composite/Aeson/TH.hs b/src/Composite/Aeson/TH.hs
--- a/src/Composite/Aeson/TH.hs
+++ b/src/Composite/Aeson/TH.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 module Composite.Aeson.TH
   ( makeFieldJsonWrapper, makeFieldJsonWrapperExplicit
   , makeRecordJsonWrapper, makeRecordJsonWrapperExplicit
@@ -90,7 +91,11 @@
         [] -- TyVarBndrs
         Nothing -- kind
         (recC wrapperName [varBangType extractorName (bangType (bang noSourceUnpackedness noSourceStrictness) fieldTy)])
-        (cxt []) -- deriving context
+#if MIN_VERSION_template_haskell(2,12,0)
+        [] -- deriving context
+#else
+        (cxt [])
+#endif
     , sigD
         formatName
         [t| forall e. JsonFormat e $(conT wrapperName) |]
@@ -187,7 +192,11 @@
         [] -- TyVarBndrs
         Nothing -- kind
         (recC wrapperName [varBangType extractorName (bangType (bang noSourceUnpackedness noSourceStrictness) recordTy)])
-        (cxt []) -- deriving context
+#if MIN_VERSION_template_haskell(2,12,0)
+        [] -- deriving context
+#else
+        (cxt [])
+#endif
     , sigD
         formatName
         [t| forall e. JsonFormat e $(conT wrapperName) |]
diff --git a/test/FieldSpec.hs b/test/FieldSpec.hs
--- a/test/FieldSpec.hs
+++ b/test/FieldSpec.hs
@@ -1,15 +1,16 @@
 module FieldSpec where
 
-import Composite (Field, (:->))
+import Composite ((:->))
+import Composite.CoRecord (Field)
 import Composite.Aeson.Base (JsonFormat, fromJsonWithFormat, toJsonWithFormat)
-import Composite.Aeson.CoRecord (defaultJsonFormatField, fieldJsonFormat, optionalField)
+import Composite.Aeson.CoRecord (defaultJsonFormatField, fieldJsonFormat)
 import Composite.Aeson.Formats.Generic (SumStyle(SumStyleFieldName))
 import Composite.TH (withPrismsAndProxies)
 import Control.Lens (_Right, review)
 import Data.Aeson.BetterErrors (parseValue)
 import Data.Aeson.QQ (aesonQQ)
 import Data.Void (Void)
-import Test.Hspec (Spec, describe, it, shouldBe, shouldNotBe)
+import Test.Hspec (Spec, describe, it, shouldBe)
 
 withPrismsAndProxies [d|
   type FFoo = "foo" :-> Int
@@ -21,7 +22,7 @@
 fieldSuite =
   describe "Field support" $ do
     let defaultFmt :: JsonFormat Void (Field TestField)
-        defaultFmt = fieldJsonFormat defaultJsonFormatField SumStyleFieldName
+        defaultFmt = fieldJsonFormat SumStyleFieldName defaultJsonFormatField
 
     it "works for encoding FFoo" $ do
       toJsonWithFormat defaultFmt (review _FFoo 123) `shouldBe` [aesonQQ| {foo: 123} |]
@@ -30,4 +31,4 @@
     it "works for decoding FFoo" $ do
       parseValue (fromJsonWithFormat defaultFmt) [aesonQQ| {foo: 123} |] `shouldBe` review (_Right . _FFoo) 123
     it "works for decoding FBar" $ do
-      parseValue (fromJsonWithFormat defaultFmt) [aesonQQ| {bar: "hi"} |] `shouldBe` review (_Right . _FBar) "hi"
+      parseValue (fromJsonWithFormat defaultFmt) [aesonQQ| {bar: "hi"} |] `shouldBe` review (_Right . _FBar) (Just "hi")
