Installation issue

I’m struggling with the project setup.

I ran this command as per instructions:

forest projects:create:nosql “HDevAdmin” --applicationHost … (other parameters)

**√** Creating your project files

**>** Hooray, installation success!
--- It analysed and created the code  

However, when I start the server

> hdevadmin@0.0.1 start:watch
> nodemon ./index.js

[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node ./index.js`
error: Forest Admin agent failed to start


TypeError: Unexpected MODIFIER at 66, expected END
    at mustConsume (/Users/suresh/HelloAR/Code/forest/dev/HDevAdmin/node_modules/path-to-regexp/dist/index.js:114:15)
    at parse (/Users/suresh/HelloAR/Code/forest/dev/HDevAdmin/node_modules/path-to-regexp/dist/index.js:172:9)
    at stringToRegexp (/Users/suresh/HelloAR/Code/forest/dev/HDevAdmin/node_modules/path-to-regexp/dist/index.js:329:27)
    at pathToRegexp (/Users/suresh/HelloAR/Code/forest/dev/HDevAdmin/node_modules/path-to-regexp/dist/index.js:407:12)
    at new Layer (/Users/suresh/HelloAR/Code/forest/dev/HDevAdmin/node_modules/@koa/router/lib/layer.js:45:17)
    at Router.register (/Users/suresh/HelloAR/Code/forest/dev/HDevAdmin/node_modules/@koa/router/lib/router.js:637:17)
    at Router.<computed> [as post] (/Users/suresh/HelloAR/Code/forest/dev/HDevAdmin/node_modules/@koa/router/lib/router.js:235:12)
    at ChartRoute.setupRoutes (/Users/suresh/HelloAR/Code/forest/dev/HDevAdmin/node_modules/@forestadmin/agent/dist/routes/access/chart.js:15:16)
    at /Users/suresh/HelloAR/Code/forest/dev/HDevAdmin/node_modules/@forestadmin/agent/dist/agent.js:155:39
    at Array.forEach (<anonymous>)


I have tried with node 16, 18 and 20

Context

  • Project name: HDevAdmin
  • Team name: .HelloAR
  • Environment name: …
  • Agent (forest package) name & version: …
  • Database type: Mongodb Atlas
  • Recent changes made on your end if any: …

Hello @Suresh_K,

Thanks for the report. It seems to be related to this bug on path-to-regexp.

I’ll investigate, as it seems related to routes construction.

Do you have collection names with dashes ?

Yes … Most of the collection names are with dashes

product_logs and under models it has created files by name “product-logs”

Can you share the Mongoose definition of a collection with dashes (not underscores) in its name?

Apologies. I dont have any collection with dashes in it… Only underscore (and multiple of them) like

external_product_lookup_info

I’ve opened a bug on our side and we will investigate the cause of this issue.

Some of the collections, have fields with + sign in it.

like this 

   'Exterior + Tyres + Apron + LHS': {
          noImperfectionChoices: [String],

---

Could that be an issue? Also, is there a way to ignore certain collection while setting up. I can ignore few collections and check if it works

Ok, it might definitively be the source of the bug. Thanks a lot for investigating. I’m adding these details to our bug description.

We will work on it shortly. Thanks a lot for your help.

Hello @Suresh_K,

We released a new version of @forestadmin/agent fixing this issue. I recommend upgrading all of your packages to the latest version.

Let me know if it works on your side.