Daml Hackathon Question re UI

It just occurred to me after uploading the application .dar to Daml Hub that I may have overlooked the UI requirement. We can run Navigator locally, but IIRC Leve did a video on using the default React/UI with some modifications for his NFT application.

I think that I should be able to source that daml-ui-tenplate project, and use that.

Is that correct?

… talk about no pressure :scream:

I think most people either start their UI by building on top of what create-daml-app provides or by starting with daml-ui-template. Which one you pick is really more a matter of taste, I think both are very great options.

1 Like
Current NPM package versions for the UI build:
# Node
$ node --version
v16.12.0
# NPM
$ npm --version
8.1.1
# List current NPM packages for the UI install
$ npm ls
getmednz@0.1.0 /home/quid/Projects/daml/code/getmednz/ui
├── @auth0/auth0-react@1.8.0
├── @daml.js/getmednz@npm:@daml.js/getmednz-0.1.0@1.17.1 -> ./daml.js/getmednz-0.1.0
├── @daml/ledger@1.17.1
├── @daml/react@1.17.1
├── @daml/types@1.17.1
├── @types/dotenv@8.2.0
├── @types/jwt-simple@0.5.33
├── @types/react-dom@16.9.14
├── @types/react@16.14.19
├── dotenv@8.6.0
├── http-proxy-middleware@1.3.1
├── jwt-simple@0.5.6
├── react-dom@16.14.0
├── react-scripts@0.9.5
├── react@16.14.0
├── semantic-ui-css@2.4.1
├── semantic-ui-react@0.88.2
└── typescript@3.8.3

I redid it 2 more, times, then actioned npm start and got the following message indicating the following steps, which I have done, from 1-4.

NPM Start Fail Help:
Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:

  /home/quid/Projects/daml/code/create-daml-app/ui/node_modules/webpack (version: 4.46.0) 

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
     This may help because npm has known issues with package hoisting which may get resolved in future versions.

  6. Check if /home/quid/Projects/daml/code/create-daml-app/ui/node_modules/webpack is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

  7. Try running npm ls webpack in your project folder.
     This will tell you which other package (apart from the expected react-scripts) installed webpack.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

npm start on the default create-daml-app now works as per spec. At least now on my slightly modified app (Which is the create-daml-app + modified daml.yaml + *.daml files), it starts the Development Server, but there are now app-specific config errors.

Progress!