2

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

parse error on input ‘]’

  • 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.

1 Answer 1

2
{-# 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 :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.