You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example "Adding the middleware - With Livereload" in the README.md breaks when updating grunt-contrib-connect to version 0.11.0 because the connect parameter is missing the methods static and directory. With version 0.10.1 it still works fine. Here is the error:
Running "connect:server" (connect) task
Warning: Object function createServer() {
function app(req, res, next){ app.handle(req, res, next); }
merge(app, proto);
merge(app, EventEmitter.prototype);
app.route = '/';
app.stack = [];
return app;
} has no method 'static' Use --force to continue.
The version history for grunt-contrib-connect says the change in this version was: update to connect 3.. I am not familiar with how connect works internally but I guess that the API has changed and the documentation here (README.md) needs to be changed as well.
The text was updated successfully, but these errors were encountered:
So the issue appears to be that [email protected] moved to using [email protected] which has a different syntax for serving static files. I've just put a bug fix in to grunt-contrib-connect to ask them to make it clearer that the syntax has changed (grunt-contrib-connect#205) however, to be clearer here the fix is to:
At the top of your Gruntfile.js you need to add:
var serveStatic = require('serve-static');
Then wherever connect.static is used you simply replace:
The example "Adding the middleware - With Livereload" in the README.md breaks when updating grunt-contrib-connect to version 0.11.0 because the
connect
parameter is missing the methodsstatic
anddirectory
. With version 0.10.1 it still works fine. Here is the error:The version history for grunt-contrib-connect says the change in this version was:
update to connect 3.
. I am not familiar with how connect works internally but I guess that the API has changed and the documentation here (README.md) needs to be changed as well.The text was updated successfully, but these errors were encountered: