trailsjs/trailpack-mongoose

Fresh Install does not work with footprints

Closed this issue · 4 comments

This was installed using yo trails and specifying hapi & mongoose

config/database.js

module.exports = {
  stores: {

    /**
     * Define a store called "local" which uses SQLite3 to persist data.
     */
    mongo: {
      migrate: 'create',
      uri: 'mongodb://xxxxxx:xxxxxxxx@xxxxxxxx.mlab.com:23000/xxxxxxtest'
    }
  },

  models: {
    defaultStore: 'mongo',
    migrate: 'drop'
  }
}

going to /api/v1/user results in a 500 error and the following outputted to the console.

Output
debug: [FootprintController] (find) model = user , criteria = {} undefined options = Debug: internal, implementation, error TypeError: Uncaught error: FootprintService.find is not a function at FootprintController.find (/home/ubuntu/workspace/node_modules/trailpack-hapi/api/controllers/FootprintController.js:49:35) at Object.exports.execute.internals.prerequisites.internals.handler.callback [as handler] (/home/ubuntu/workspace/node_modules/hapi/lib/handler.js:96:36) at /home/ubuntu/workspace/node_modules/hapi/lib/handler.js:63:26 at done (/home/ubuntu/workspace/node_modules/hapi/node_modules/items/lib/index.js:31:25) at done (/home/ubuntu/workspace/node_modules/hapi/node_modules/items/lib/index.js:63:25) at /home/ubuntu/workspace/node_modules/hapi/lib/handler.js:49:28 at finalize (/home/ubuntu/workspace/node_modules/hapi/lib/handler.js:281:20) at wrapped (/home/ubuntu/workspace/node_modules/hapi/node_modules/hoek/lib/index.js:867:20) at internals.Response._prepare.internals.Response._processPrepare.next [as _processPrepare] (/home/ubuntu/workspace/node_modules/hapi/lib/response.js:457:16) at internals.Response._prepare.next [as _prepare] (/home/ubuntu/workspace/node_modules/hapi/lib/response.js:396:21) at /home/ubuntu/workspace/node_modules/hapi/lib/reply.js:151:22 at nextTickCallbackWith0Args (node.js:420:9) at process._tickDomainCallback (node.js:390:13)

it is known that this error is when an model can not be found, however the model is visible from the console via app.orm.User

app info

{  
   "app":"0.0.0",
   "node":"v4.4.0",
   "libs":{  
      "http_parser":"2.5.2",
      "node":"4.4.0",
      "v8":"4.5.103.35",
      "uv":"1.8.0",
      "zlib":"1.2.8",
      "ares":"1.10.1-DEV",
      "icu":"56.1",
      "modules":"46",
      "openssl":"1.0.2g"
   },
   "trailpacks":[  
      {  
         "name":"core",
         "version":"1.0.0-beta-6"
      },
      {  
         "name":"repl",
         "version":"1.0.2"
      },
      {  
         "name":"router",
         "version":"1.0.0-beta-4"
      },
      {  
         "name":"hapi",
         "version":"1.0.0-beta-5"
      },
      {  
         "name":"mongoose",
         "version":"0.1.0"
      },
      {  
         "name":"footprints",
         "version":"1.0.0-beta-6"
      }
   ]
}
0cv commented

Just run into the same issue. Looks like the npm package is outdated compared to the GitHub version, this file https://github.com/trailsjs/trailpack-mongoose/blob/master/api/services/FootprintService.js is completely empty in npm.

Fixed temporarily the issue by updating my package.json with "trailpack-mongoose": "github:trailsjs/trailpack-mongoose"

just redid a fresh trails install, updated the npm package as you suggested and now I get no footprint routes generated.

also with the update I can not do console commands for the ORM as well.

@Krisa @randallmeeker pushed new version with changes and fixes.
Also upgraded dependencies.