<p>You must have built Plutus from the latest commit, some things have changed I believe. The reason is <code>submitTxConstraintsWith</code> returns a type of <code>Contract w s e CardanoTx</code> but <code>txId</code> requires the type <code>Tx</code>. Replace <code>TxId</code> with <code>getCardanoTxId</code> and it should work.</p>
<p>If you want to follow the Pioneer Program tutorials you need to build with the commit hash used in the lectures, for lesson 1 it is: <code>ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4</code></p>

CC BY-SA 4.0
2021-12-07T09:31:23.003Z
But I want to use a recent version.
Vladimir Kovalchuk
CC BY-SA 4.0
2022-01-06T10:47:36.733Z
the `getCardanoTxId` fixed for me, thx!
Edwin
CC BY-SA 4.0
2021-12-06T22:46:04.057Z
2021-12-06T23:01:44.727Z
2021-12-06T23:01:44.727Z
Montario
<p>I have this error when compiling Week01 from Pioneer Program:</p>
<pre><code>error:
• Couldn't match type ‘Either SomeCardanoApiTx Tx’ with ‘Tx’
  Expected type: Tx
    Actual type: CardanoTx
• In the first argument of ‘txId’, namely ‘ledgerTx’
  In the second argument of ‘($)’, namely ‘txId ledgerTx’
  In the second argument of ‘($)’, namely
    ‘awaitTxConfirmed $ txId ledgerTx’

void $ awaitTxConfirmed $ txId ledgerTx
</code></pre>
<p>How to fix the error?</p>

<plutus><plutus-pioneer-program>
Couldn't match type ‘Either SomeCardanoApiTx Tx’ with ‘Tx’
# Couldn't match type ‘Either SomeCardanoApiTx Tx’ with ‘Tx’

(Asked by: username_0 on 2021-12-06)

I have this error when compiling Week01 from Pioneer Program:
error:
• Couldn't match type ‘Either SomeCardanoApiTx Tx’ with ‘Tx’
  Expected type: Tx
    Actual type: CardanoTx
• In the first argument of ‘txId’, namely ‘ledgerTx’
  In the second argument of ‘($)’, namely ‘txId ledgerTx’
  In the second argument of ‘($)’, namely
    ‘awaitTxConfirmed $ txId ledgerTx’

void $ awaitTxConfirmed $ txId ledgerTx

How to fix the error?

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

---

## 1 answers

### Answer by username_1 on 2021-12-06. Score: 3 | Accepted answer

You must have built Plutus from the latest commit, some things have changed I believe. The reason is `submitTxConstraintsWith` returns a type of `Contract w s e CardanoTx` but `txId` requires the type `Tx`. Replace `TxId` with `getCardanoTxId` and it should work.

If you want to follow the Pioneer Program tutorials you need to build with the commit hash used in the lectures, for lesson 1 it is: `ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4`

> **Comments:**
> **username_0**: But I want to use a recent version.  
> **username_2**: the `getCardanoTxId` fixed for me, thx!  

---

