diff --git a/Database/Persist/TH.hs b/Database/Persist/TH.hs
--- a/Database/Persist/TH.hs
+++ b/Database/Persist/TH.hs
@@ -1444,10 +1444,12 @@
         Just entityJSON -> do
             entityJSONIs <- if mpsGeneric mps
               then [d|
+#if MIN_VERSION_base(4, 6, 0)
                 instance PersistStore backend => ToJSON (Entity $(pure typ)) where
                     toJSON = $(varE (entityToJSON entityJSON))
                 instance PersistStore backend => FromJSON (Entity $(pure typ)) where
                     parseJSON = $(varE (entityFromJSON entityJSON))
+#endif
                 |]
               else [d|
                 instance ToJSON (Entity $(pure typ)) where
diff --git a/persistent-template.cabal b/persistent-template.cabal
--- a/persistent-template.cabal
+++ b/persistent-template.cabal
@@ -1,5 +1,5 @@
 name:            persistent-template
-version:         2.0.2.1
+version:         2.0.2.2
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -28,6 +28,7 @@
                    , unordered-containers
                    , tagged
                    , path-pieces
+                   , ghc-prim
     exposed-modules: Database.Persist.TH
     ghc-options:     -Wall
     if impl(ghc >= 7.4)
