# Development work flow

**URL:** <https://community.forestadmin.com/t/development-work-flow/2993>\
**Category:** Help me!\
**Tags:** setup\
**Created:** [July 27, 2021, 1:54pm UTC](https://community.forestadmin.com/t/development-work-flow/2993 "2021-07-27T13:54:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tauseef\_Ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/tauseef_ahmed/32/2771_2.png) [@Tauseef\_Ahmed](https://community.forestadmin.com/u/Tauseef_Ahmed)\
**Post date:** [July 27, 2021, 1:54pm UTC](https://community.forestadmin.com/t/development-work-flow/2993/1 "2021-07-27T13:54:34Z")

</div>

Hi,

I am trying to run an existing Backend Admin (e.g models , routes etc..), the developer who work earlier commit all files from his system including .env.

I already install all packages and and after npm start i can see below output

Model creation error: ReferenceError: models is not defined  
Your application is listening on port 3310.  
Your admin panel is available here: [https://app.forestadmin.com/projects](https://app.forestadmin.com/projects)

## Expected behavior

I am expecting the to server run successfully and when I open [https://app.forestadmin.com/projects](https://app.forestadmin.com/projects) my project it points to my local machine backend.

## Actual behavior

In Server startup, I am seeing this error  
Model creation error: ReferenceError: models is not defined

as well when I open [https://app.forestadmin.com/projects](https://app.forestadmin.com/projects) \> My Project in browser console below error

chunk.7.3063f605868b6fe645c9.js:325 Error while processing route: project.rendering.index Cannot read property ‘type’ of undefined TypeError: Cannot read property ‘type’ of undefined  
at l.h.\_pushInternalModel ([https://app.forestadmin.com/assets/vendor-c07624b566e0c950b81e97ff61b6e54f.js:14785:104](https://app.forestadmin.com/assets/vendor-c07624b566e0c950b81e97ff61b6e54f.js:14785:104))  
at [https://app.forestadmin.com/assets/vendor-c07624b566e0c950b81e97ff61b6e54f.js:14785:38](https://app.forestadmin.com/assets/vendor-c07624b566e0c950b81e97ff61b6e54f.js:14785:38)

## Context

Please provide any relevant information about your setup.

- Package Version:
- Express Version: ~4.17.1
- Sequelize Version: ~5.15.1
- Database Dialect:
- Database Version:
- Project Name:

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [July 27, 2021, 2:24pm UTC](https://community.forestadmin.com/t/development-work-flow/2993/2 "2021-07-27T14:24:57Z")

</div>

Hello @Tauseef_Ahmed, and welcome to the Forest Admin community 🎉 !!!

Can you tell me which version of `forest-express-sequelize` you are using please?  
Do you have an explicit stack trace with the errors, the file and the line where it breaks?

Thank you,

---

<div class="post-metadata">

**Author:** ![Tauseef\_Ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/tauseef_ahmed/32/2771_2.png) [@Tauseef\_Ahmed](https://community.forestadmin.com/u/Tauseef_Ahmed)\
**Post date:** [July 27, 2021, 3:13pm UTC](https://community.forestadmin.com/t/development-work-flow/2993/3 "2021-07-27T15:13:12Z")

</div>

Hi @Guillaume_Cisco,

Thanks for your prompt response, we have “forest-express-sequelize”: “^7.0.0”, installed

On UI side check screenshot below for error details

 ![Screenshot 2021-07-27 at 17.09.59](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/e/e44b7ec4d21e6aba1a7eaff5ee0b2ec76b2f0c5d.jpeg)

When I am running the server on Admin Backend there is only this error

Model creation error: ReferenceError: models is not defined

I verified DB access and it works fine also I am login in lumber-cli as well.

I am not sure for existing project if i need to perform some actions from Cli

Regards

Tauseef Ahmed

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [July 27, 2021, 3:49pm UTC](https://community.forestadmin.com/t/development-work-flow/2993/4 "2021-07-27T15:49:55Z")

</div>

Ok, so we need to understand why you get the error:

```javascript
Model creation error: ReferenceError: models is not defined

```

You will need to find where in your code the `models` variable is not defined.  
Do you know if you need to follow upgrade notes from a previous version of `forest-express-sequelize`?

---

<div class="post-metadata">

**Author:** ![Tauseef\_Ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/tauseef_ahmed/32/2771_2.png) [@Tauseef\_Ahmed](https://community.forestadmin.com/u/Tauseef_Ahmed)\
**Post date:** [July 27, 2021, 4:15pm UTC](https://community.forestadmin.com/t/development-work-flow/2993/5 "2021-07-27T16:15:28Z")

</div>

Ok i found that and fixing below lines resolve this issue

```javascript
  Property.associate = (models) => {
  };
  Property.belongsTo(models.c2CUser, {
    foreignKey: {
      name: 'userIdKey',
      field: 'user_id',
    },
    as: 'user',
  });

```

Seems like the DB structure change after the first setup of Forestadmin I will check with the backend team about that

But even after commenting above lines error is resolve but still, when I access ForestAdmin UI \> My App it showing the same error i attached earlier

Do we need to run the lumber update command?

Regards

Tauseef Ahmed

---

<div class="post-metadata">

**Author:** ![Tauseef\_Ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/tauseef_ahmed/32/2771_2.png) [@Tauseef\_Ahmed](https://community.forestadmin.com/u/Tauseef_Ahmed)\
**Post date:** [July 27, 2021, 7:26pm UTC](https://community.forestadmin.com/t/development-work-flow/2993/6 "2021-07-27T19:26:49Z")

</div>

Hi,

Also, can you explain what is

FOREST\_ENV\_SECRET and FOREST\_AUTH\_SECRET and from where I get their values?

Regards

Tauseef Ahmed

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [July 28, 2021, 7:30am UTC](https://community.forestadmin.com/t/development-work-flow/2993/7 "2021-07-28T07:30:38Z")

</div>

Hello @Tauseef_Ahmed,

I suggest you to play with `lumber update` or directly create a new project to see how the structure should look like.

`FOREST_ENV_SECRET` is the variable pertained to your project in order for us to identify it.  
`FOREST_AUTH_SECRET` is a secret key you can modify, it is used for authentication processus, especially JWT.

I hope it helps 😉

---

<div class="post-metadata">

**Author:** ![Tauseef\_Ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/tauseef_ahmed/32/2771_2.png) [@Tauseef\_Ahmed](https://community.forestadmin.com/u/Tauseef_Ahmed)\
**Post date:** [July 28, 2021, 7:50am UTC](https://community.forestadmin.com/t/development-work-flow/2993/8 "2021-07-28T07:50:50Z")

</div>

Hello @Guillaume_Cisco

Right now I have FOREST\_AUTH\_SECRET which I copied from my colleague env file, can I generate my own FOREST\_AUTH\_SECRET using my ForestAdmin account? if yes can you explain the steps?

I will try with a new project as well but right now I am documenting steps to init existing project, as we need to hand over this work to another team.

The interesting fact is same code working fine with my colleague who set up this from the beginning but cloning that on my system not, seems like some steps are missing.

Regards

Tauseef Ahmed

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [July 28, 2021, 7:57am UTC](https://community.forestadmin.com/t/development-work-flow/2993/9 "2021-07-28T07:57:55Z")

</div>

Hello @Tauseef_Ahmed,

Do you have the possibility to check what is different with the setup from your colleague?  
I think it will help 🤩

Be careful when modifying `FOREST_AUTH_SECRET`, all the users connected to your project will be logged out, as all current JWTs will be invalid. All the users will need to login again to access your data.  
`FOREST_AUTH_SECRET` is not something you generate, you can put any passphrase you want.  
It can be a base 64 encoded uuid for example.

I hope it helps 😉

---

<div class="post-metadata">

**Author:** ![Tauseef\_Ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/tauseef_ahmed/32/2771_2.png) [@Tauseef\_Ahmed](https://community.forestadmin.com/u/Tauseef_Ahmed)\
**Post date:** [July 28, 2021, 8:27am UTC](https://community.forestadmin.com/t/development-work-flow/2993/10 "2021-07-28T08:27:42Z")

</div>

Hi @Guillaume_Cisco

Thanks yeah I am checking that, we have the exact file structure, anyway i am still verifying

Regards

Tauseef Ahmed
