Cannot Resolve template ID Locally
- rikotacardsOP
Issue I’m running into:
When trying to rundaml starton a dummy project lists other Dars as dependencies, I run into the “Cannot Resolve Template ID” error locally. (I have uploaded the separate dars onto daml hub, and uploaded the ui zip, and there are no issues on daml hub)I’m working on a project where the current structure looks like this:
parent main (where I have the daml models) /Account /daml/Account.daml daml.yaml (User, Asset as dependencies) /Asset /daml/Asset.daml daml.yaml /User /daml/User.daml daml.yaml /LocalDev (this is the dummy project) /daml/LocalDev.daml daml.yaml (listing Account, User, Asset dar paths as dependencies)I first run
daml buildfor the following:- Asset
- User
- Account
and finally LocalDev
I then run codegen for Asset, User, Account
daml codegen js main/Asset/.daml/dist/asset-0.0.1.dar main/User/.daml/dist/user-0.0.1.dar main/Account/.daml/dist/account-0.0.1.dar -o ui/daml.jswhich produces a daml.js file in my UI directory. And I run npm install.In one terminal, in the LocalDev directory, I’ll run
daml start, in another terminal in the ui directory, I runnpm startI get error when I try to login:

Within the LocalDev
.daml > dependenciesfile, I can see 5b1e9…
Within the daml.js file in the UI directory, I don’t see the package ID directly at the first layer where the package IDs are listed, is that the issue?
However, when I go into ‘User-0.0.1’
It seems that themodule.jsfile references 5b1e9…
Where I’m uncertain about:
Am I creating the dummy project correctly? The LocalDev directory has a daml.yaml file withsdk-version: 1.18.1 name: LocalDev source: daml version: 0.0.1 dependencies: - daml-prim - daml-stdlib - daml-script - ../Asset/asset.dar - ../User/user.dar - ../Account/account.dar sandbox-options: - --wall-clock-time - --ledgerid=wallet-refapp-sandboxAm I running the codegen correctly with only Asset, User, and Account
daml codegen js main/Asset/.daml/dist/asset-0.0.1.dar main/User/.daml/dist/user-0.0.1.dar main/Account/.daml/dist/account-0.0.1.dar main/LocalDev/.daml/dist/LocalDev-0.0.1.dar -o ui/daml.jsI’ve tried to include LocalDev dar as well, and same error.
- Mate_Varga 1
The error message you receive suggests that the package for your User template is not know by your ledger. Please make sure that your packages are included in the dar file you start your sandbox with by running:
daml damlc inspect-dar <path-to-LocalDev.dar>The User, Asset and Account packages should be listed under “DAR archive contains the following packages:”
- rikotacards 2
The issue it seems stems from the empty daml project in my dummy project.
Similar issue I posted here:
Multiple Dars on Hub, and Single Dar to Run Locally, What to do with Frontend React? - #4 by rikotacards- if the daml file is empty, no dars are uploaded
- if the daml file has a dummy template, yet the templates don’t import the Asset, Account, User module, no dars are uploaded
So the solution if to use a dummy project is to create a dummy template as well,
module LocalDev where import Asset import Account import User template LocalDev with owner: Party notUsedAsset: Asset notUsedAccount: Account.AssetHoldingAccount notUsedUser: User where signatory ownerThough this template is completely unused, it is necessary when running
daml startand having the other dars to be uploaded to the sandbox.An alternative solution from @Mate_Varga , is to simply use:
daml sandbox --ledgerid wallet-refapp-sandbox main/Asset/asset.dar main/User/user.dar main/Account/account.darThis loads the dars into the sandbox, then the next step which I was missing when troubleshooting is running
daml json-api --ledger-host localhost --ledger-port 6865 --http-port 7575and finally in another terminal run
npm startfor the UI.By doing that, we can avoid the use of a dummy project altogether.


