Error in daml.js I don't understand
- DarkoOP
The following error shows up when using the
useStreamQueriesreact hook filtering for a specific template.We’ve tried regenerating the js code, deleting
node_modulesandpackage-lock.json, to no avail.The same error appears with node 14, 16, and 18.
Below is an excerpt of the error message.
Does anyone have a pointer how to fix it?
TypeError: damlTypes.assembleInterface is not a function (anonymous function) /Users/yonathang/Documents/projects/cbdc-sandbox/ui/daml.js/cbdc-sandbox-0.0.1/lib/DA/Interfaces/Attestation/AttestationToken/module.js:15 12 | /* eslint-disable-next-line no-unused-vars */ 13 | var damlLedger = require('@daml/ledger'); 14 | > 15 | exports.AttestationToken = damlTypes.assembleInterface( 16 | '7eaaf2a2b6b23cf6c97b6f34c594be8df67e04cba09f6364cfdc347e2ed9c260:DA.Interfaces.Attestation.AttestationToken:AttestationToken', 17 | function () { return exports.View; }, 18 | { - cocreature
Can you check your version of
daml-typesthat you specified inpackage.json? Maybe even share yourpackage-lock.json? - Stephen
Indeed, this almost certainly indicates that your
@daml/typesdependency is too old for the codegen version you’re using now.