# Forest Typescript: IDE complains about the load hook

**URL:** <https://community.forestadmin.com/t/forest-typescript-ide-complains-about-the-load-hook/3268>\
**Category:** Help me!\
**Tags:** typescript\
**Created:** [September 13, 2021, 9:19am UTC](https://community.forestadmin.com/t/forest-typescript-ide-complains-about-the-load-hook/3268 "2021-09-13T09:19:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SoftwareBridgementKe](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/softwarebridgementke/32/3066_2.png) [@SoftwareBridgementKe](https://community.forestadmin.com/u/SoftwareBridgementKe)\
**Post date:** [September 13, 2021, 9:19am UTC](https://community.forestadmin.com/t/forest-typescript-ide-complains-about-the-load-hook/3268/1 "2021-09-13T09:19:10Z")

</div>

## Expected behavior

```javascript
{
    name: 'Add Collection',
    type: 'single',
    fields: [
        {
            field: 'Tracking',
            type: 'Enum',
            enums: [],
            description:
                'Tracking for normal collections.',
            isRequired: true
        }
    ],
    hooks: {
        load: async ({ fields, request }) => {
                    const id = parseInt(request.body.data.attributes.ids[0]);
                    const descriptions = repo.findAll(id);
                    trackingField.enums = descriptions;
                    return fields;
                }
        }
    }

```

In the above piece of code, visual studio code gives the error:

```javascript
Type '({ fields, request }: { fields: SmartActionLoadHookField[]; request: SmartActionLoadHookRequest; }) => Promise<SmartActionLoadHookField[]>' is not assignable to type 'SmartActionLoadHook'.
  Type 'Promise<SmartActionLoadHookField[]>' is missing the following properties from type 'SmartActionLoadHookField[]': length, pop, push, concat, and 26 more.ts(2322)
(property) SmartActionHooks.load: Liana.SmartActionLoadHook

```

I would expect no error as the code itself works fine. Seems to be a typing issue

## Actual behavior

IDE finds errors in functional code.

## Context

Please provide any relevant information about your setup.

- Package Version: “forest-express-sequelize”: “^8.0.6”
- Express Version: “express”: “^4.17.1”
- Sequelize Version: “sequelize”: “6.6.2”
- Database Dialect: postgres

## Side note

As a side note, why does the forest interface for a smart action field not have a widget as a property?

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [September 13, 2021, 12:25pm UTC](https://community.forestadmin.com/t/forest-typescript-ide-complains-about-the-load-hook/3268/2 "2021-09-13T12:25:28Z")

</div>

Hi @SoftwareBridgementKe 👋 welcome to our community. Thank for your feedback, this is indeed an issue. I will open a bug report and we reach you here when the issue are fixed.

---

<div class="post-metadata">

**Author:** ![SoftwareBridgementKe](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/softwarebridgementke/32/3066_2.png) [@SoftwareBridgementKe](https://community.forestadmin.com/u/SoftwareBridgementKe)\
**Post date:** [October 6, 2021, 4:36pm UTC](https://community.forestadmin.com/t/forest-typescript-ide-complains-about-the-load-hook/3268/3 "2021-10-06T16:36:29Z")

</div>

Hi @Arnaud_Moncel, is there any update on this issue?

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [October 7, 2021, 7:31am UTC](https://community.forestadmin.com/t/forest-typescript-ide-complains-about-the-load-hook/3268/4 "2021-10-07T07:31:24Z")

</div>

Hi @SoftwareBridgementKe 👋 we released a fix on `forest-express-sequelize` yesterday you can update the package to version 8.3.2 and let me know if it work properly 🙏

---

<div class="post-metadata">

**Author:** ![SoftwareBridgementKe](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/softwarebridgementke/32/3066_2.png) [@SoftwareBridgementKe](https://community.forestadmin.com/u/SoftwareBridgementKe)\
**Post date:** [October 7, 2021, 1:43pm UTC](https://community.forestadmin.com/t/forest-typescript-ide-complains-about-the-load-hook/3268/5 "2021-10-07T13:43:29Z")

</div>

Hi,  
Yes this fixed my issue, thank you.  
~~However, I am noticing a new issue after upgrading to the latest release, will create a seperate topic for that.~~  
Nevermind, all is good.
