-
Notifications
You must be signed in to change notification settings - Fork 6
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
No Longer works with Hapi 9.3.1 #12
Comments
Hey thank you very much for the report. I am going to take a look at what can be done. Up to you. Aurélien |
All right, I just publish a new version: 0.10.0 Would you mind trying with your configuration to see is act as usual? Please note as well that |
Hi there, I was wondering if you had time to take a look at that release? Thanks |
The bad news is it still doesnt work. The good news is that it gives a new error: Fatal error: Hapi ["/Users/dpatton/Documents/Git/HDFS-Viz/server/server.js"] - Error: Cannot start server while it is in initializing state I also tried this with Hapi 10.3.1 |
The only thing I can think of right now is that Hapi might get started twice. Please note that Starting the server can be put in a start script (and used only in Production), letting Grunt manage it for Dev and Testing. This was how the If it's not ideal, we can think about something else but in the meantime, would you be kind enough to tell me if it works without calling start yourself? |
If I start via node server/server.js it starts fine. |
I am going to take a look. Would you mind to paste your Grunt configuration (The grunt-hapi part would suffice) please? My point was, if the server script you give to And I guess that you can't "start" an hapi server twice. |
Heres the whole Gruntfile: // Generated on 2014-12-16 using // # Globbing module.exports = function(grunt) {
}; |
Thank you ! That is very helpful. I can't help but to try to push my idea to the end though. The script you give as a server entry to I would be really curious to see the result of removing that part from your server.js file:
And moved to another file used only for production. Thank you so much again |
I think I found a fix to this issue. Instead of removing my server start code to another file I wrapped it it with:
I also did the same in the lib/forkme.js file:
That seems to have done the trick. |
It might not be a bad idea for me to add it to the Thanks for the follow up ! |
Hapi 9.3.1 requires that the Inert plugin be manually included for static content. This breaks grunt-hapi which now gives the error:
Fatal error: Hapi ["/Users/dpatton/Documents/Git/HDFS-Viz/server/server.js"] - Error: Missing required start callback function
Here is the relevant section of my server file
const Hapi = require('hapi'); //http://hapijs.com/api
const inert = require('inert');
const server = new Hapi.Server();
server.connection({
host: config.server.host,
address: config.server.host,
port: config.server.port
});
server.register(inert, function (err) {});
server.route({
method: 'GET',
path: '/{param*}',
handler: {
directory: {
path: process.cwd() + '/app',
index: true
}
}
});
/** Other routes ... **/
/***********************
Server Start
***********************/
server.start(function (err) {
if (err) {
log.error(err);
}
log.info('Server running at ' + server.info.uri);
});
module.exports = server;
The text was updated successfully, but these errors were encountered: