# Issue building project with advanced configuration on Node with express and mongoose

**URL:** <https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721>\
**Category:** Help me!\
**Tags:** setup, dashboard\
**Created:** [October 3, 2023, 6:45pm UTC](https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721 "2023-10-03T18:45:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Carpenter](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jacob_carpenter/32/6543_2.png) [@Jacob\_Carpenter](https://community.forestadmin.com/u/Jacob_Carpenter)\
**Post date:** [October 3, 2023, 6:45pm UTC](https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721/1 "2023-10-03T18:45:09Z")

</div>

## Feature(s) impacted

Building of the project is waylaid as Node throws and error on build.

## Observed behavior

On build of the server, debug throws the following error:

```javascript
Uncaught SyntaxError C:\Users\jakec\source\project-root\server\node_modules\@forestadmin\agent\dist\agent.js:187
        if (!experimental?.webhookCustomActions && isProduction) {

```

## Expected behavior

I was expecting the server to build without error.

## Context

- Project name: NFPD
- Team name: FRSS
- Environment name: Unsure
- Agent (forest package) name & version:  
“@forestadmin/agent”: “^1.35.2”,  
“@forestadmin/datasource-mongoose”: “^1.5.25”,
- Database type: noSQL MongoDB
- Recent changes made on your end if any: This is the initial integration of this Forest into my project.

---

<div class="post-metadata">

**Author:** ![Florian\_Gonzales](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/florian_gonzales/32/5541_2.png) [@Florian\_Gonzales](https://community.forestadmin.com/u/Florian_Gonzales)\
**Post date:** [October 4, 2023, 9:46am UTC](https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721/2 "2023-10-04T09:46:46Z")

</div>

Hello @Jacob_Carpenter and welcome to our community 🎉 🎉,

Can you tell me which version of node you are using? 🙏

Kind regards,

Florian

---

<div class="post-metadata">

**Author:** ![Jacob\_Carpenter](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jacob_carpenter/32/6543_2.png) [@Jacob\_Carpenter](https://community.forestadmin.com/u/Jacob_Carpenter)\
**Post date:** [October 4, 2023, 4:14pm UTC](https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721/3 "2023-10-04T16:14:18Z")

</div>

Of Course, we are on Node 18.18.0 but downgrading to 16.13.0 results in the same issue.

---

<div class="post-metadata">

**Author:** ![Florian\_Gonzales](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/florian_gonzales/32/5541_2.png) [@Florian\_Gonzales](https://community.forestadmin.com/u/Florian_Gonzales)\
**Post date:** [October 5, 2023, 8:59am UTC](https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721/4 "2023-10-05T08:59:09Z")

</div>

It’s very strange if your node version is up to date. 🤔 Apparently the optional chaining operator syntax (?. ) has been supported since node version 14. Do you use special things like babel or similar?

---

<div class="post-metadata">

**Author:** ![Jacob\_Carpenter](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jacob_carpenter/32/6543_2.png) [@Jacob\_Carpenter](https://community.forestadmin.com/u/Jacob_Carpenter)\
**Post date:** [October 5, 2023, 3:47pm UTC](https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721/5 "2023-10-05T15:47:29Z")

</div>

we use “@babel/eslint-parser”: “7.21.8”

Our babelrc is just a single line  
{  
“plugins”: [“@babel/plugin-syntax-optional-chaining”]  
}

---

<div class="post-metadata">

**Author:** ![Florian\_Gonzales](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/florian_gonzales/32/5541_2.png) [@Florian\_Gonzales](https://community.forestadmin.com/u/Florian_Gonzales)\
**Post date:** [October 6, 2023, 1:29pm UTC](https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721/6 "2023-10-06T13:29:35Z")

</div>

I I think your problem is linked to Babel 🤔, which must not support this type of operator. Can you try updating babel? 🙏

---

<div class="post-metadata">

**Author:** ![Jacob\_Carpenter](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jacob_carpenter/32/6543_2.png) [@Jacob\_Carpenter](https://community.forestadmin.com/u/Jacob_Carpenter)\
**Post date:** [October 6, 2023, 5:39pm UTC](https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721/7 "2023-10-06T17:39:43Z")

</div>

I had success just editing out the operator that was throwing errors. I had removed babel entirely but still had the same issue, so I may just need to fork the repo for my particular use case. That said I am having one more issue that I can’t seem to find any resources on. I have a ‘Profile’ Service that acts as a way to peel off sensitive data from my Account model but it seems forest is trying to find a complete DB collection for it. It’s throwing this error:

Uncaught Error Error: Collection ‘Profile’ not found. List of available collections: Account, Value

I imagine this is happening because I have a profile controller and service but no DB collection, I’m just not sure how to fix it.

---

<div class="post-metadata">

**Author:** ![Florian\_Gonzales](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/florian_gonzales/32/5541_2.png) [@Florian\_Gonzales](https://community.forestadmin.com/u/Florian_Gonzales)\
**Post date:** [October 12, 2023, 2:48pm UTC](https://community.forestadmin.com/t/issue-building-project-with-advanced-configuration-on-node-with-express-and-mongoose/6721/8 "2023-10-12T14:48:00Z")

</div>

Hello @Jacob_Carpenter 👋,

I’m having trouble understanding why you have a problem with forest. 🤔 Could you share a repo with the project that’s causing the problem (or, if it contains sensitive data, a project with the minimum amount of code that reproduces the problem)? 🙏 It would help me a lot.

Kind regards,

Florian
