<p>Assuming the week04 code is unchanged, ensure you have run checked out commit <a href="https://github.com/input-output-hk/plutus-pioneer-program/blob/6be7484d4b8cffaef4faae30588c7fb826bcf5a3/code/week04/cabal.project#L45" rel="nofollow noreferrer">ea1bfc</a> in the <code>plutus-apps</code> repo and run <code>nix-shell</code> within plutus-apps. Then switch to the week 4 directory in the nix shell and <code>cabal build</code> should work.</p>

CC BY-SA 4.0
2022-12-04T17:59:42.737Z
2022-12-04T17:59:42.737Z
21eleven
<p>I try to compile code from <a href="https://github.com/input-output-hk/plutus-pioneer-program/blob/6be7484d4b8cffaef4faae30588c7fb826bcf5a3/code/week04/src/Week04/Vesting.hs#L64" rel="nofollow noreferrer">Plutus Pioneer Program week 4</a>. These lines cause error.</p>
<pre><code>typedValidator :: Scripts.TypedValidator Vesting
typedValidator = Scripts.mkTypedValidator @Vesting
    $$(PlutusTx.compile [|| mkValidator ||])
    $$(PlutusTx.compile [|| wrap ||])
  where
    wrap = Scripts.wrapValidator @VestingDatum @()
</code></pre>
<p>Here is the error:</p>
<pre><code>Not in scope: `Scripts.wrapValidator'
Perhaps you meant one of these:
`Scripts.tvValidator' (imported from Ledger.Typed.Scripts),
data constructor `Scripts.TypedValidator' (imported from Ledger.Typed.Scripts)
Module `Ledger.Typed.Scripts' does not export `wrapValidator'.
</code></pre>
<p>That is strange because from the <a href="https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger/html/Ledger-Typed-Scripts.html#t:Any" rel="nofollow noreferrer">documentation</a> there is the instance <code>wrapValidator</code> in <code>Ledger.Typed.Scripts</code></p>
<blockquote>
<p>wrapValidator :: forall d r. (UnsafeFromData d, UnsafeFromData r) =&gt; (d -&gt; r -&gt; ScriptContext -&gt; Bool) -&gt; WrappedValidatorType</p>
</blockquote>
<p>How do I fix this?</p>

<plutus><plutus-pioneer-program>
Module `Ledger.Typed.Scripts' does not export `wrapValidator'
# Module `Ledger.Typed.Scripts' does not export `wrapValidator'

(Asked by: username_0 on 2022-12-04)

I try to compile code from Plutus Pioneer Program week 4. These lines cause error.
typedValidator :: Scripts.TypedValidator Vesting
typedValidator = Scripts.mkTypedValidator @Vesting
    $$(PlutusTx.compile [|| mkValidator ||])
    $$(PlutusTx.compile [|| wrap ||])
  where
    wrap = Scripts.wrapValidator @VestingDatum @()

Here is the error:
Not in scope: `Scripts.wrapValidator'
Perhaps you meant one of these:
`Scripts.tvValidator' (imported from Ledger.Typed.Scripts),
data constructor `Scripts.TypedValidator' (imported from Ledger.Typed.Scripts)
Module `Ledger.Typed.Scripts' does not export `wrapValidator'.

That is strange because from the documentation there is the instance wrapValidator in Ledger.Typed.Scripts

wrapValidator :: forall d r. (UnsafeFromData d, UnsafeFromData r) => (d -> r -> ScriptContext -> Bool) -> WrappedValidatorType

How do I fix this?

**Tags:** plutus, plutus-pioneer-program

---

## 1 answers

### Answer by username_1 on 2022-12-04. Score: 0 | Accepted answer

Assuming the week04 code is unchanged, ensure you have run checked out commit [ea1bfc](https://github.com/input-output-hk/plutus-pioneer-program/blob/6be7484d4b8cffaef4faae30588c7fb826bcf5a3/code/week04/cabal.project#L45) in the `plutus-apps` repo and run `nix-shell` within plutus-apps. Then switch to the week 4 directory in the nix shell and `cabal build` should work.


---

