Skip to content
Discussions/App Development/Error while exercise choice from daml-ui-templateForum ↗

Error while exercise choice from daml-ui-template

App Development7 posts577 views9 likesLast activity Dec 2020
PA
palanisamycOP
Dec 2020

I have a simple daml model that using daml ui template. while exercising the choice, it’s throwing the error(screen shot attached). However, the choice is successfully excercised.

I have done the “make clean” and rebuild. Can you please help me out to fix this issue?

BE
bernhard
Dec 2020

Hi @palanisamyc, welcome to the DAML forums! Your error looks like the one discussed here: I get "Trying to look up template ..." error in front end

Do the solutions there fix your problem?

PA
palanisamyc
Dec 2020

Hi Bernhard,

Thanks for the response. After following the instructions mentioned in the reference thread, i am getting the below error,

package.json file contents as below,

{

  "name": "clinical-trials-ts",

  "version": "0.0.1",

  "private": true,

  "dependencies": {

    "@daml.js/clinical-trials-0.0.1": "file:../daml.js/clinical-trials-0.0.1",

    "@daml/ledger": "1.7.0",

    "@daml/react": "1.7.0",

    "@daml/types": "1.7.0",

    "@material-ui/core": "^4.3.0",

    "@material-ui/icons": "^4.2.1",

    "@material-ui/styles": "^4.3.0",

    "@types/react-router": "^5.1.8",

    "jsonwebtoken": "^8.5.1",

    "react": "^16.12.0",

    "react-dom": "^16.12.0",

    "react-router-dom": "5.2.0",

    "history": "4.10.0",

    "tinycolor2": "^1.4.1"

  },

  "resolutions": {

    "**/**/set-value": "^2.0.1",

    "**/**/mixin-deep": "^1.3.2"

  },

  "scripts": {

    "start": "react-scripts start",

    "build": "react-scripts build",

    "test": "react-scripts test",

    "eject": "react-scripts eject",

    "lint": "eslint --ext .js,.jsx,.ts,.tsx --max-warnings 0 src/"

  },

  "eslintConfig": {

    "extends": "react-app"

  },

  "browserslist": {

    "production": [

      ">0.2%",

      "not dead",

      "not op_mini all"

    ],

    "development": [

      "last 1 chrome version",

      "last 1 firefox version",

      "last 1 safari version"

    ]

  },

  "proxy": "http://localhost:7575",

  "devDependencies": {

    "@types/history": "4.7.6",

    "@types/jsonwebtoken": "^8.5.0",

    "@types/react": "^17.0.0",

    "@types/react-dom": "^16.9.8",

    "@types/react-router-dom": "5.1.5",

    "@types/tinycolor2": "^1.4.2",

    "react-scripts": "^3.4.1",

    "typescript": "^3.9.5"

  }

}

BE
bernhard
Dec 2020

That looks like a typescript error in the UI code. Is this a component you’ve written yourself, or is it an example that’s available somewhere?

PA
palanisamyc
Dec 2020

This code is from the daml ui code base. Did anyone face this issue anytime before?

CO
cocreature
Dec 2020

This looks like you might have ended up with two different versions of @types/history. Could you share your yarn.lock file (if using yarn) or package-lock.json (if using npm)?

CO
cocreature
Dec 2020

Hi @palanisamyc, this issue was caused by using a newer version of @types/history than the one in daml-ui-templates yarn.lock file. We have updated daml-ui-template today to work against the latest version of @types/history which should resolve the issue.

← Back to Discussions