# Get Started tutorial does not work

**URL:** <https://forum.canton.network/t/get-started-tutorial-does-not-work/5653>\
**Category:** App Development\
**Created:** [November 15, 2022, 4:57pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653 "2022-11-15T16:57:53Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![schwobi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@schwobi](https://forum.canton.network/u/schwobi)\
**Post date:** [November 15, 2022, 4:57pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/1 "2022-11-15T16:57:53Z")

</div>

Hi all,

I’m trying to create the full-stack DAML app referring to [Getting Started with Daml — Daml SDK 2.4.0 documentation](https://docs.daml.com/getting-started/index.html).

I have created MessageList.tsx and MessageEdit.tsx, copy and pasted the code from the tutorial, however it shows me errors:

**MessageList.tsx:**  
Property ‘Message’ does not exist on type ‘typeof import(“c:/Users/myuser/myapp/ui/node\_modules/@daml.js/myapp/lib/User/index”)’.ts(2339)

Property ‘sender’ does not exist on type ‘{}’.ts(2339)  
Property ‘receiver’ does not exist on type ‘{}’.  
Property ‘content’ does not exist on type ‘{}’.ts(2339)

**MessageEdit.tsx:**

Property ‘SendMessage’ does not exist on type ‘Template\<User, string, “3e79e02f8c408a0506afcd6348344977294486816a781d905515ecc0c131377b:User:User”\> & ToInterface\<User, never\> & UserInterface’.ts(2339)

**User.daml:**

```haskell
-- Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0

module User where

-- MAIN_TEMPLATE_BEGIN
template User with
    username: Party
    following: [Party]
  where
    signatory username
    observer following
-- MAIN_TEMPLATE_END

    key username: Party
    maintainer key

    -- FOLLOW_BEGIN
    nonconsuming choice Follow: ContractId User with
        userToFollow: Party
      controller username
      do
        assertMsg "You cannot follow yourself" (userToFollow /= username)
        assertMsg "You cannot follow the same user twice" (notElem userToFollow following)
        archive self
        create this with following = userToFollow :: following
    -- FOLLOW_END

    nonconsuming choice SendMessage: ContractId Message with
        sender: Party
        content: Text
      controller sender
      do
        assertMsg "Designated user must follow you back to send a message" (elem sender following)
        create Message with sender, receiver = username, content  
                                                                 
                                      
-- ALIAS_BEGIN
template Alias with
    username: Party
    alias: Text
    public: Party
  where
    signatory username
    observer public

    key (username, public) : (Party, Party)
    maintainer key._1

    nonconsuming choice Change: ContractId Alias with
        newAlias: Text
      controller username
      do
        archive self
        create this with alias = newAlias
-- ALIAS_END

-- 
template Message with
    sender: Party
    receiver: Party
    content: Text
  where
    signatory sender, receiver

                                     

```

My environment:  
**SDK: 2.4.0**  
**NodeJS version: v14.21.1**  
**Yarn version: v1.22.19**  
**OS: Windows**

Could you please help me to fix the issues? Where can I find the complete example? I could not find it on Github. I thought, I could “cheat” with that 🙂

Thanks,  
Schwobi

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [November 15, 2022, 5:16pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/2 "2022-11-15T17:16:50Z")

</div>

Have you re-run the codegen after modifying the User.daml file? If you have `daml start` running it should watch for file changes and run it automatically, but otherwise you can run it manually with `daml codegen js` from the project root (the folder that has the `daml.yaml` file).

Also make sure you have the `User.daml` file saved.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 15, 2022, 5:23pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/3 "2022-11-15T17:23:35Z")

</div>

`daml start` does not watch for file changes automatically. You need to press `r` followed by `Return` in the terminal you started it for it to pick up the changes you made. Based on the error you get it seems like that’s the missing step.

---

<div class="post-metadata">

**Author:** ![schwobi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@schwobi](https://forum.canton.network/u/schwobi)\
**Post date:** [November 15, 2022, 5:26pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/4 "2022-11-15T17:26:47Z")

</div>

> [@Gary\_Verhaegen](#):
>
> daml codegen j

Hi Gary,

Files are saved. Daml start is running but tried daml codegen js manually as well, still facing

```haskell
PS C:\myapp\ui> yarn start
yarn run v1.22.19
$ react-scripts start
[HPM] Proxy created: function (pathname, req) {
  // Proxy requests to the http json api when in development
  const proxied = pathname.match("^/v1") && process.env.NODE_ENV === "development";
Failed to compile.

C:/myapp/ui/ui/src/components/MessageEdit.tsx
TypeScript error in C:/myapp/ui/src/components/MessageEdit.tsx(29,48):
Property 'SendMessage' does not exist on type 'Template<User, string, "3e79e02f8c408a0506afcd6348344977294486816a781d905515ecc0c131377b:User:User"> & ToInterface<User, never> & UserInterface'. TS2339

    27 | }
    28 | setIsSubmitting(true);
  > 29 | await ledger.exerciseByKey(User.User.SendMessage, receiver, {sender, content});
       | ^
    30 | setContent("");
    31 | } catch (error) {
    32 | alert(`Error sending message:\n${JSON.stringify(error)}`);

```

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 15, 2022, 5:28pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/5 "2022-11-15T17:28:04Z")

</div>

If you are using `yarn` rather than NPM I believe you have to manually run `yarn install` after you reran the codegen.

---

<div class="post-metadata">

**Author:** ![schwobi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@schwobi](https://forum.canton.network/u/schwobi)\
**Post date:** [November 15, 2022, 5:29pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/6 "2022-11-15T17:29:33Z")

</div>

Hi,

I did r+enter and then in the other terminal I have ‘yarn start’ again but still get the same error.

---

<div class="post-metadata">

**Author:** ![schwobi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@schwobi](https://forum.canton.network/u/schwobi)\
**Post date:** [November 15, 2022, 5:34pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/7 "2022-11-15T17:34:09Z")

</div>

```haskell
yarn install
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.72s.

```

yarn start gives me the same error.

```haskell
yarn start
yarn run v1.22.19
$ react-scripts start
[HPM] Proxy created: function (pathname, req) {
  // Proxy requests to the http json api when in development
  const proxied = pathname.match("^/v1") && process.env.NODE_ENV === "development";
Failed to compile.
Failed to compile.

C:/myapp/ui/src/components/MessageEdit.tsx
TypeScript error in C:/Umyapp/ui/src/components/MessageEdit.tsx(29,48):
Failed to compile.

C:/myapp/ui/src/components/MessageEdit.tsx
TypeScript error in C:/myapp/ui/src/components/MessageEdit.tsx(29,48):
Failed to compile.

C:/myapp/ui/src/components/MessageEdit.tsx
TypeScript error in C:/myapp/ui/src/components/MessageEdit.tsx(29,48):
Property 'SendMessage' does not exist on type 'Template<User, string, "3e79e02f8c408a0506afcd6348344977294486816a781d905515ecc0c131377b:User:User"> & ToInterface<User, never> & UserInterface'. TS2339

    27 | }
    28 | setIsSubmitting(true);
  > 29 | await ledger.exerciseByKey(User.User.SendMessage, receiver, {sender, content});
       | ^
    30 | setContent("");
    31 | } catch (error) {
    32 | alert(`Error sending message:\n${JSON.stringify(error)}`);

```

---

<div class="post-metadata">

**Author:** ![schwobi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@schwobi](https://forum.canton.network/u/schwobi)\
**Post date:** [November 15, 2022, 5:37pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/8 "2022-11-15T17:37:12Z")

</div>

Do you know, where can I find the source code for the tutorial related to SDK 2.4.0 presented on [Getting Started with Daml — Daml SDK 2.4.0 documentation](https://docs.daml.com/getting-started/index.html)? I did not find it on Github. It would be great to have working solutions, which can be reviewed and tried out.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 15, 2022, 5:42pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/9 "2022-11-15T17:42:07Z")

</div>

Please try these steps in this order:

1. Close any `daml start` or `yarn start` windows you still have open.
2. Make sure your `User.daml` file is saved and you added the `SendMessage` choice to the `User` template.
3. Run `daml build`
4. Run `daml codegen js`
5. From the `ui` directory run `yarn install`
6. Now you can run `yarn start` from the UI directory again
7. and `daml start`

---

<div class="post-metadata">

**Author:** ![schwobi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@schwobi](https://forum.canton.network/u/schwobi)\
**Post date:** [November 15, 2022, 5:50pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/10 "2022-11-15T17:50:18Z")

</div>

Hi,

No success, still the same. I will try to do tomorrow everything from scratch, maybe I missed something.

Do you know, where can I find the source code for the tutorial related to SDK 2.4.0 presented on [Getting Started with Daml — Daml SDK 2.4.0 documentation](https://docs.daml.com/getting-started/index.html)? I did not find it on Github. It would be great to have working solutions, which can be reviewed and tried out. I think it would be beneficial for newbies like me.

Thanks,  
Schwobi

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 15, 2022, 5:59pm UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/11 "2022-11-15T17:59:11Z")

</div>

The source is in [daml/templates/create-daml-app at main · digital-asset/daml · GitHub](https://github.com/digital-asset/daml/tree/main/templates/create-daml-app). The changes for messaging only exist as a patch to that in [daml/messaging.patch at ff194c379ec8489509774e5a2c6f2cda693b1bb8 · digital-asset/daml · GitHub](https://github.com/digital-asset/daml/blob/ff194c379ec8489509774e5a2c6f2cda693b1bb8/templates/create-daml-app-test-resources/messaging.patch). I don’t think the sources are the issue here. It sounds more like some commands got run in the wrong order.

Can you try using NPM like the tutorial describes and see if that works?

---

<div class="post-metadata">

**Author:** ![schwobi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@schwobi](https://forum.canton.network/u/schwobi)\
**Post date:** [November 16, 2022, 7:12am UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/12 "2022-11-16T07:12:27Z")

</div>

Do I need a special version of NPM?

```haskell
npm -v
9.1.1
PS C:\myapp\ui> npm install
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: babel-jest@26.6.3
npm WARN Found: @babel/core@7.12.3
npm WARN node_modules/babel-jest/node_modules/@babel/core
npm WARN peer @babel/core@"^7.0.0" from babel-preset-jest@26.6.2
npm WARN node_modules/babel-jest/node_modules/babel-preset-jest
npm WARN babel-preset-jest@"^26.6.2" from babel-jest@26.6.3
npm WARN node_modules/babel-jest
npm WARN 3 more (babel-preset-current-node-syntax, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer @babel/core@"^7.0.0" from babel-jest@26.6.3
npm WARN node_modules/babel-jest
npm WARN babel-jest@"^26.6.3" from jest-config@26.6.3
npm WARN node_modules/jest-config

added 1 package, removed 9 packages, changed 95 packages, and audited 1695 packages in 24s
Failed to compile.

C:/myapp/ui/src/components/MessageEdit.tsx
TypeScript error in C:/myapp/ui/src/components/MessageEdit.tsx(29,48):
Property 'SendMessage' does not exist on type 'Template<User, string, "3e79e02f8c408a0506afcd6348344977294486816a781d905515ecc0c131377b:User:User"> & ToInterface<User, never> & UserInterface'. TS2339

    27 | }
    28 | setIsSubmitting(true);
  > 29 | await ledger.exerciseByKey(User.User.SendMessage, receiver, {sender, content});
       | ^
    30 | setContent("");
    31 | } catch (error) {
    32 | alert(`Error sending message:\n${JSON.stringify(error)}`);

```

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 16, 2022, 7:27am UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/13 "2022-11-16T07:27:17Z")

</div>

iirc NPM 9 has some issues, try NPM 8 (shipped with node 18)

---

<div class="post-metadata">

**Author:** ![schwobi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@schwobi](https://forum.canton.network/u/schwobi)\
**Post date:** [November 16, 2022, 7:43am UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/14 "2022-11-16T07:43:12Z")

</div>

I’ve found in some other discuss post that nodeJS 14 or 16 is recommended for DAML.

I’ve installed NPM version to 6.14.17 which is the default version for NodeJS 14.21.1 based on [Previous Releases | Node.js](https://nodejs.org/en/download/releases/). It seems to be fine, however it still does not work:

 ![Capture](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/5/5ea5e0afed52fc7e83009e5ed819c69912936c9a.png)

If I check the source code, I got new errors in MessageEdit.tsx:

JSX element type ‘Form’ does not have any construct or call signatures.ts(2604)

JSX element class does not support attributes because it does not have a ‘props’ property.ts(2607)  
‘Button’ cannot be used as a JSX component.  
Its instance type ‘Button’ is not a valid JSX element.  
Type ‘Button’ is missing the following properties from type ‘ElementClass’: render, context, setState, forceUpdate, and 3 more.ts(2786)

* * *

MessageList.tsx:  
JSX element type ‘List’ does not have any construct or call signatures.ts(2604)

Could you please tell me the exact version (nodeJS, NPM) you’re using and this example works?

Thanks!

---

<div class="post-metadata">

**Author:** ![schwobi](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@schwobi](https://forum.canton.network/u/schwobi)\
**Post date:** [November 16, 2022, 8:22am UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/15 "2022-11-16T08:22:19Z")

</div>

I could resolve it.

Stack for the tutorial example:

SDK: 2.4.0  
NodeJS: v16.18.1  
NPM: 8.19.2

It would be good, if the official webpage would be updated with that.

I spent two days “getting started” with DAML… ☹

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 16, 2022, 8:36am UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/16 "2022-11-16T08:36:25Z")

</div>

Sorry that it took so long but glad you figured it out!

---

<div class="post-metadata">

**Author:** ![ontansel](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/ontansel/32/5266_2.png) [@ontansel](https://forum.canton.network/u/ontansel)\
**Post date:** [November 22, 2022, 5:13am UTC](https://forum.canton.network/t/get-started-tutorial-does-not-work/5653/17 "2022-11-22T05:13:42Z")

</div>

Thanks, this saved me a lot of time and frustration.
