hoodiehq / ember-hoodie

Build awesome offline-first Ember apps with Hoodie!
MIT License
17 stars 6 forks source link

Error: Request logging is disabled #29

Open brunopedroso opened 8 years ago

brunopedroso commented 8 years ago

I'm running this example app and, at the moment I submit the login request the process is running ember s stops with the following error:

/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/hoek/lib/index.js:736
    throw new Error(msgs.join(' ') || 'Unknown error');
    ^

Error: Request logging is disabled
    at Object.exports.unique.exports.contain.exports.reachTemplate.exports.assert.condition [as assert] (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/hoek/lib/index.js:736:11)
    at internals.Request.internals.Request.getLog (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/lib/request.js:252:10)
    at new exports.GreatResponse (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/good/lib/utils.js:142:24)
    at Object.exports.GreatResponse (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/good/lib/utils.js:83:16)
    at internals.Monitor._responseHandler (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/good/lib/monitor.js:244:33)
    at invoke (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/podium/lib/index.js:239:30)
    at invoke (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/podium/lib/index.js:243:13)
    at Object.exports.parallel (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/items/lib/index.js:70:13)
    at Object.internals.Podium.registerEvent.internals.Podium.registerPodium.internals.emit.each [as emit] (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/podium/lib/index.js:260:18)
    at internals.Podium.registerEvent.internals.Podium.registerPodium.internals.Podium._emit (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/podium/lib/index.js:140:15)
    at each (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/podium/lib/index.js:181:47)
    at Object.exports.parallel (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/items/lib/index.js:70:13)
    at relay (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/podium/lib/index.js:182:15)
    at Object.internals.Podium.registerEvent.internals.Podium.registerPodium.internals.emit.each [as emit] (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/podium/lib/index.js:186:16)
    at Immediate._onImmediate (/Users/bruno/workspace/ember-hoodie-example-app/node_modules/hapi/node_modules/podium/lib/index.js:169:38)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

I researched a little and found out that this error is thrown by this assert.

I changed these lines to include routes: { log: true } just like someone proposed here, and the error stopped.

gr2m commented 8 years ago

I think this was resolved via https://github.com/hoodiehq/hoodie/pull/600, released in https://github.com/hoodiehq/hoodie/releases/tag/v24.2.1, can you check please?

brunopedroso commented 8 years ago

Actually, that does not solve the problem. I'm already on hoodie 24.2.2...

It looks like these lines do not use getHapiOptions()...

gr2m commented 8 years ago

you are right! Hmm ... We kinda have a lot of code duplication here. I wonder if we should use some internal code here from the hoodie package, like the getHapiOptions method, like so

var getHapiOptions = require('hoodie/cli/hapi-options')

it’s usually bad practice, but still better than duplicating the code and risking it gets out of sync like it did now.

Another option is to remove the server component entirely from ember-hoodie and document how to set it up yourself, to make it more explicit ...

What do you think?

brunopedroso commented 8 years ago

I must say I feel, as an app dev, it's very inviting to install an ember addon, type ember s and already have hoodie ready for development! I wont remove this...

Maybe the hoodie module could expose a configured hapi server instance?

gr2m commented 8 years ago

it's very inviting to install an ember addon, type ember s and already have hoodie ready for development!

Yeah I agree

Maybe the hoodie module could expose a configured hapi server instance?

I’m not sure what you mean by that? We can either use hoodie which comes with the whole package, or we use @hoodie/server which only has the backend components for store & account

brunopedroso commented 8 years ago

I mean, if ember-hoodie must require an internal file inside hoodie module, then I think it would be more meaningful to me to import a configured instance than to import a getHapiOptions method... something similar to what is done here when it imports the whole run function.

just an idea, btw...

brunopedroso commented 8 years ago

actually, the run function does configre other things... not just the connection options, but also a a server options and who know what else eventually...