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

Uncaught error: Cannot read property 'isBoom' of null in hapi/lib/handler.js #2242

Closed
toymachiner62 opened this issue Dec 2, 2014 · 7 comments
Closed
Assignees
Labels
Milestone

Comments

@toymachiner62
Copy link

@toymachiner62 toymachiner62 commented Dec 2, 2014

I'm trying to get my plugin working with hapi version 8 and i'm getting this stacktrace pointing at line https://github.com/hapijs/hapi/blob/v8.0.0-rc5/lib/handler.js#L75 when running one of my tests.

Debug: internal, implementation, error 
    TypeError: Uncaught error: Cannot read property 'isBoom' of null
    at finalize (/Users/m089269/Sites/hapi-authorization/node_modules/hapi/lib/handler.js:75:21)
    at Function.wrapped [as _next] (/Users/m089269/Sites/hapi-authorization/node_modules/hapi/node_modules/hoek/lib/index.js:798:20)
    at Function.internals.continue (/Users/m089269/Sites/hapi-authorization/node_modules/hapi/lib/reply.js:105:10)
    at server.route.handler (/Users/m089269/Sites/hapi-authorization/test/index.js:81:95)
    at Object.internals.handler (/Users/m089269/Sites/hapi-authorization/node_modules/hapi/lib/handler.js:91:27)
    at /Users/m089269/Sites/hapi-authorization/node_modules/hapi/lib/handler.js:30:23
    at internals.Protect.run (/Users/m089269/Sites/hapi-authorization/node_modules/hapi/lib/protect.js:56:5)
    at exports.execute (/Users/m089269/Sites/hapi-authorization/node_modules/hapi/lib/handler.js:24:22)
    at /Users/m089269/Sites/hapi-authorization/node_modules/hapi/lib/request.js:321:13
    at iterate (/Users/m089269/Sites/hapi-authorization/node_modules/hapi/node_modules/items/lib/index.js:35:13)
    at done (/Users/m089269/Sites/hapi-authorization/node_modules/hapi/node_modules/items/lib/index.js:27:25)
    at /Users/m089269/Sites/hapi-authorization/node_modules/hapi/node_modules/hoek/lib/index.js:781:22
    at process._tickDomainCallback (node.js:463:13)
Debug: internal, implementation, error 
    AssertionError: expected '{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"}' to equal 'TEST'
    at /Users/m089269/Sites/hapi-authorization/test/index.js:90:28
    at /Users/m089269/Sites/hapi-authorization/node_modules/hapi/lib/connection.js:249:16
    at /Users/m089269/Sites/hapi-authorization/node_modules/hapi/node_modules/shot/lib/index.js:191:13
    at process._tickDomainCallback (node.js:463:13)
    at process._tickFromSpinner (node.js:394:15)

The test i'm trying to run: https://github.com/toymachiner62/hapi-authorization/blob/hapi8/test/index.js#L78 and this is the last line in my code that I believe it gets to before failing https://github.com/toymachiner62/hapi-authorization/blob/hapi8/lib/index.js#L191

Any ideas on this? Is this a bug with hapi 8?

@bendrucker
Copy link
Contributor

@bendrucker bendrucker commented Dec 2, 2014

Why are you trying to call reply.continue from the handler? That means you don't actually set a reply. If you change it to a plain reply you should be fine.

Loading

@toymachiner62
Copy link
Author

@toymachiner62 toymachiner62 commented Dec 2, 2014

Are you referring to this handler https://github.com/toymachiner62/hapi-authorization/blob/hapi8/test/index.js#L81 ? I shouldn't be using reply.continue in here?

Loading

@bendrucker
Copy link
Contributor

@bendrucker bendrucker commented Dec 2, 2014

Correct

Loading

@toymachiner62
Copy link
Author

@toymachiner62 toymachiner62 commented Dec 2, 2014

Works. Thanks.

Loading

@hueniverse hueniverse added the bug label Dec 2, 2014
@hueniverse hueniverse self-assigned this Dec 2, 2014
@hueniverse hueniverse added this to the 8.0.0 milestone Dec 2, 2014
@hueniverse hueniverse reopened this Dec 2, 2014
@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Dec 2, 2014

This is a bug. reply.continue() in the handler should be the same as reply(null).

Loading

@hueniverse hueniverse closed this in 3170797 Dec 2, 2014
@j
Copy link
Contributor

@j j commented Dec 2, 2014

Yeah, I set up 8.0 to get into it the last couple days and hit so many exceptions regarding pre-handlers, authentication, and handlers in general... It'd be nice to have cleaner exceptions than uncaught error invalid property handling.

Loading

@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Dec 2, 2014

Please report all of them. Even incorrect user code errors can be made more useful.

Loading

@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants