trailsjs / trailpack-hapi

:package: Hapi.js Trailpack
MIT License
19 stars 9 forks source link

this.app.packs is not defined #5

Closed jaumard closed 8 years ago

jaumard commented 8 years ago

Under https://github.com/trailsjs/trailpack-hapi/blob/master/index.js in validate method you test this.app.packs but is not define you should test this.app.config.main.packs or change the core to copie this.app.config.main.packs on this.app.packs.

tjwebb commented 8 years ago

or change the core to copie this.app.config.main.packs on this.app.packs.

The core does copy everything over, and indexes by pack name: https://github.com/trailsjs/trails/blob/master/index.js#L77. Are you still seeing this issue?

jaumard commented 8 years ago

As I see packs are not copy, you only doing a .map on them (if I understand correctly). To fix it I have to add this.packs = packs at the end of the bindTrailpackMethodListeners method. I can PR if you think it's correct.

tjwebb commented 8 years ago

OK; either way, I don't think it's specific to the trailpack-hapi module, right? Let's discuss further in the main trails repo