Hi,
I am using the updated daml-ui-template for our internal project and running into following issue.
Model
template BuyerInvitation
with
buyer : Party
operator : Party
where
signatory operator
controller buyer can
AcceptBuyerInvitation : ContractId BuyerRole
do
create UserRole with userParty = buyer, role = "BUYER"
create BuyerRole with buyer, operator
UI : js code
export default function Report() {
const ledger = useLedger();
const assets = useStreamQuery(Main.BuyerInvitation);
const exerciseInvite = function(cid) {
ledger.exercise(Main.BuyerInvitation.AcceptBuyerInvitation, cid, { });
};
return (
<>
<Contracts
contracts={assets.contracts}
columns={[
["ContractId", "contractId"],
["User", "payload.buyer"],
]}
actions={[["Accept", (c) => { exerciseInvite(c.contractId); }]]}
/>
</>
);
}
Behaviour
Site shows the page correctly with the default Accept button.
On clicking it, the Ledger gets updated, but then the browser shows the error page
Unhandled Rejection (Error): Trying to look up template a7830cfe0a3c035aa616b1a12e4e6722b90725815a4bfa253974a716dace1644:Main:BuyerInvitation.
▼ 2 stack frames were expanded.
push.../node_modules/@daml/ledger/node_modules/@daml/types/index.js.exports.lookupTemplate
C:/Work/DigitalAsset/POC/node_modules/@daml/ledger/node_modules/@daml/types/index.js:30
(anonymous function)
C:/Work/DigitalAsset/POC/node_modules/@daml/ledger/index.js:96
▲ 2 stack frames were expanded.
(anonymous function)
C:/Work/DigitalAsset/POC/src/decoder.ts:795
792 | */
793 | andThen = <B>(f: (value: A) => Decoder<B>): Decoder<B> =>
794 | new Decoder<B>((json: unknown) =>
> 795 | Result.andThen(value => f(value).decode(json), this.decode(json))
| ^ 796 | );
797 |
798 | /**
View compiled
Any ideas on what the issue might be?