Trying to re-register template
I built some packages - Inventory, PurchaseOrder, Core
daml/1.1.1/develop/PurchaseOrder/daml.yaml
data-dependencies:
- …/Inventory/.daml/dist/tydei-dev-inventory-1.1.1.dar
daml/1.1.1/develop/Core/daml.yaml
data-dependencies:
- …/Inventory/.daml/dist/tydei-dev-inventory-1.1.1.dar
- …/PurchaseOrder/.daml/dist/tydei-dev-purchaseorder-1.1.1.dar
And, I built and codegen them
DAML_PROJECT=${root_dir}/daml/${daml_version}/develop/Inventory daml build
DAML_PROJECT=${root_dir}/daml/${daml_version}/develop/Inventory daml codegen js -o ${root_dir}/daml2js ${root_dir}/daml/${daml_version}/develop/Inventory/.daml/dist/tydei-dev-inventory-${daml_version}.dar…
ui-js/package.json
"@daml2js/tydei-dev-core": "file:../daml2js/tydei-dev-core-1.1.1",
"@daml2js/tydei-dev-purchaseorder": "file:../daml2js/tydei-dev-purchaseorder-1.1.1",
"@daml2js/tydei-dev-inventory": "file:../daml2js/tydei-dev-inventory-1.1.1",
While running the UI, I faced an error.
Trying to re-register template 8bb05de52b51d99fc4ad44f6cdf3b5dc26b3f1683cdf59dfbdc58daca5d21a09:Inventory.Main.Inventory:InventoryLocation.
Who can help me to fix it?
That’s not an error, just a warning. If you don’t perform calls to registerTemplate in client code, I believe there is a possibility that multiple code generation outputs try to register the same template because it occurs multiple times if that template happens to be a dependency of multiple modules (e.g. here it looks like both PurchaseOrder and Core depend on Inventory, which seems to match the warning you shared in a screenshot). It mostly seems benign and to my understanding re-registering is effectively idempotent when managed through the codegen. Is there some specific reason why you think you should get rid of this warning?
@stefanobaghino-da , I thought it should be fixed. But if it’s okay as you mentioned, then I’d like to work with these warnings. Thank you.
