user4405: I have a code that compiles and runs well in the Plutus playground, but when I try to run cabal build I get an error when calling mkTypedValidator:
offerValidator :: Scripts.TypedValidator Offer
offerValidator = Scripts.mkTypedValidator @Offer
    $$(PlutusTx.compile [|| validateOffer ||])
    $$(PlutusTx.compile [|| wrap ||]) where
        wrap = Scripts.wrapValidator @OfferData @OfferAction



using ghc version ghc-8.10.7
cabal version 3.6.0

Any ideas what might be happening? Not very experienced with cabal/plutus yet.
Also already tried cabal update but looks like everything is up-to-date.

user4405: {-# LANGUAGE DataKinds                  #-}
{-# LANGUAGE DeriveAnyClass             #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE DerivingStrategies         #-}
{-# LANGUAGE FlexibleContexts           #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase                 #-}
{-# LANGUAGE MultiParamTypeClasses      #-}
{-# LANGUAGE NoImplicitPrelude          #-}
{-# LANGUAGE OverloadedStrings          #-}
{-# LANGUAGE RecordWildCards            #-}
{-# LANGUAGE ScopedTypeVariables        #-}
{-# LANGUAGE TemplateHaskell            #-}
{-# LANGUAGE TypeApplications           #-}
{-# LANGUAGE TypeFamilies               #-}
{-# LANGUAGE TypeOperators              #-}
{-# LANGUAGE BangPatterns               #-}

Looks like I was missing some imports that are not necessary in the playground, but are still necessary when building with cabal. Will leave this here since it may help someone else :)

4405: <p>I have a code that compiles and runs well in the Plutus playground, but when I try to run cabal build I get an error when calling mkTypedValidator:</p>
<pre><code>offerValidator :: Scripts.TypedValidator Offer
offerValidator = Scripts.mkTypedValidator @Offer
    $$(PlutusTx.compile [|| validateOffer ||])
    $$(PlutusTx.compile [|| wrap ||]) where
        wrap = Scripts.wrapValidator @OfferData @OfferAction
</code></pre>
<p><a href="https://i.stack.imgur.com/oum30.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oum30.png" alt="parse error on input ‘]’" /></a></p>
<ul>
<li>using ghc version ghc-8.10.7</li>
<li>cabal version 3.6.0</li>
</ul>
<p>Any ideas what might be happening? Not very experienced with cabal/plutus yet.</p>
<p>Also already tried <code>cabal update</code> but looks like everything is up-to-date.</p>
 4405: <pre><code>{-# LANGUAGE DataKinds                  #-}
{-# LANGUAGE DeriveAnyClass             #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE DerivingStrategies         #-}
{-# LANGUAGE FlexibleContexts           #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase                 #-}
{-# LANGUAGE MultiParamTypeClasses      #-}
{-# LANGUAGE NoImplicitPrelude          #-}
{-# LANGUAGE OverloadedStrings          #-}
{-# LANGUAGE RecordWildCards            #-}
{-# LANGUAGE ScopedTypeVariables        #-}
{-# LANGUAGE TemplateHaskell            #-}
{-# LANGUAGE TypeApplications           #-}
{-# LANGUAGE TypeFamilies               #-}
{-# LANGUAGE TypeOperators              #-}
{-# LANGUAGE BangPatterns               #-}
</code></pre>
<p>Looks like I was missing some imports that are not necessary in the playground, but are still necessary when building with cabal. Will leave this here since it may help someone else :)</p>
