# Sequelize TypeError

**URL:** <https://community.forestadmin.com/t/sequelize-typeerror/3196>\
**Category:** Help me!\
**Created:** [September 2, 2021, 2:06pm UTC](https://community.forestadmin.com/t/sequelize-typeerror/3196 "2021-09-02T14:06:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitchell\_Lloyd](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/mitchell_lloyd/32/1902_2.png) [@Mitchell\_Lloyd](https://community.forestadmin.com/u/Mitchell_Lloyd)\
**Post date:** [September 2, 2021, 2:06pm UTC](https://community.forestadmin.com/t/sequelize-typeerror/3196/1 "2021-09-02T14:06:24Z")

</div>

Hey folks, wondering if you could help me with an issue I’m getting when using one of the examples in the Forest Admin docs

## Expected behavior

Should be able to do

```javascript
 const lesson = await new RecordGetter(
      lessons,
      request.user,
      request.query
    ).get(request.params.recordId);

```

following an example from here [Prevent record update | Woodshop for old agent generation](https://docs.forestadmin.com/woodshop/how-tos/prevent-record-update-based-on-specific-criterias)  
Should be able to log the lesson record once the promise has successfully resolved.

## Actual behavior

What is the current behavior?

At the moment, I’m getting a TypeError:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/b/bfcef588c711ad0178efb757d3453788d9a838d3.png)  
which must be coming from Sequelize. Not sure how to resolve this issue - unless it is something wrong with the version

“express”: “^4.17.1”,  
“forest-express-sequelize”: “^7.3.1”,  
Database Dialect: postgres  
postgres:12  
“sequelize”: “~5.15.1”

- Project Name: Oak National Academy

---

<div class="post-metadata">

**Author:** ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)\
**Post date:** [September 2, 2021, 2:20pm UTC](https://community.forestadmin.com/t/sequelize-typeerror/3196/2 "2021-09-02T14:20:38Z")

</div>

Hi @Mitchell_Lloyd, hope you are doing well.

You are using the version 7 of `forest-express-sequelize` with an example code for the v8 😕  
An easy fix for this would be to switch from

```javascript
const lesson = await new RecordGetter(
      lessons,
      request.user,
      request.query
    )

```

To

```javascript
 const lesson = await new RecordGetter(
      lessons,
    )

```

Or switch to our latest v8 😃

Let me know if that helps 🙏

---

<div class="post-metadata">

**Author:** ![Mitchell\_Lloyd](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/mitchell_lloyd/32/1902_2.png) [@Mitchell\_Lloyd](https://community.forestadmin.com/u/Mitchell_Lloyd)\
**Post date:** [September 3, 2021, 2:25pm UTC](https://community.forestadmin.com/t/sequelize-typeerror/3196/3 "2021-09-03T14:25:31Z")

</div>

Thanks @anon39848301 this solved the problem perfectly !  
🙂
