hapi icon indicating copy to clipboard operation
hapi copied to clipboard

Blank screen when trying to upgrade to hapi 9.3.1

Open johnnygames opened this issue 11 years ago • 2 comments

This may be a stupid error, but I am having problems migrating hapi from ~6 to 9.3.1. It seems like the changes are mainly in the plugin area inert, vision, and h2o2. This is just a snippet from my server. I get a blank white screen when I try set this up, any ideas/help? I get 200 responses and no errors anywhere when I run this code as well. Thanks!

var server = new Hapi.Server();

  server.connection({port: port});
  server.register([
    require('vision'),
    require('inert'),
    require('h2o2')], function(error) {
    if (error) {
      console.log('Plugin load failed: ' + error);
    }

    server.views({
      engines: {
        html: require('handlebars')
      },
      path: Path.join(__dirname, './backend/views')
    });

    server.route({
      method: 'GET',
      path: '/login',
      handler: function(request, reply) {
        if (isLoggedIn(request)) {
            reply.redirect('/');
          }
        } else {
          var viewOpts =  {};
          reply.view('login', viewOpts);
        }
      }
    });
  });

johnnygames avatar Nov 17 '15 01:11 johnnygames

Your code works for me. https://github.com/nlindley/hapi-vision-test

nlindley avatar Nov 17 '15 02:11 nlindley

Can't really help with this. You can try opening an issue on hapijs/discuss and provide more information.

hueniverse avatar Nov 21 '15 22:11 hueniverse