Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Views solution not passing #92

Closed
mpmckenna8 opened this issue Oct 18, 2014 · 3 comments
Closed

Views solution not passing #92

mpmckenna8 opened this issue Oct 18, 2014 · 3 comments

Comments

@mpmckenna8
Copy link

When running the example solution to views I get this error

/Users/matthewmckenna/Documents/strenode/mehapi/node_modules/hapi/node_modules/joi/lib/errors.js:136
var annotated = JSON.stringify(obj, null, 2);
                     ^
TypeError: Converting circular structure to JSON
    at Object.stringify (native)
    at Error.internals.annotate (/Users/matthewmckenna/Documents/strenode/mehapi/node_modules/hapi/node_modules/joi/lib/errors.js:136:26)
at Object.exports.assert (/Users/matthewmckenna/Documents/strenode/mehapi/node_modules/hapi/lib/schema.js:15:104)
at new module.exports.internals.Server (/Users/matthewmckenna/Documents/strenode/mehapi/node_modules/hapi/lib/server.js:79:12)
at Object.exports.createServer (/Users/matthewmckenna/Documents/strenode/mehapi/node_modules/hapi/lib/index.js:14:12)
at Object.<anonymous> (/Users/matthewmckenna/Documents/strenode/mehapi/cheat.js:13:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)

I also get the same error when just trying to start the server using port 8080 not running it with makemehapi.

Using node 0.10.29

@mpmckenna8
Copy link
Author

Though it will validate if the view isn't an options object but set like:

var Hapi = require('hapi'); var Path = require('path');
var viPo = process.argv[2];

var server = Hapi.createServer('localhost', viPo);
server.views({
engines: {
    html: require('handlebars')
},
path: Path.join(__dirname, 'templates')
});
server.route({path:'/', method:'GET', handler:{view:'template.html'}})

server.start();

@MatthewLarner
Copy link

Looks like this was a breaking change in 7.0
hapijs/hapi#2023

linclark added a commit that referenced this issue Nov 9, 2014
Fix for #92 'Views solution not passing'
@linclark
Copy link
Contributor

linclark commented Nov 9, 2014

Thanks, this was fixed with 15e396a

@linclark linclark closed this as completed Nov 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants