gruntjs - grunt-contrib-connect | root path must be a string Use -


while running grunt task, getting following error.

running "connect:client" (connect) task warning: root path must string use --force continue. typeerror: root path must string     @ function.servestatic (/users/marif/dev/javascript/javascript-boilerplate/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/serve-static/index.js:43:11)     @ object.livereloadmiddleware (/users/marif/dev/javascript/javascript-boilerplate/gruntfile.js:25:23)     @ object.<anonymous> (/users/marif/dev/javascript/javascript-boilerplate/node_modules/grunt-contrib-connect/tasks/connect.js:110:41)     @ object.<anonymous> (/users/marif/dev/javascript/javascript-boilerplate/node_modules/grunt/lib/grunt/task.js:264:15)     @ object.thistask.fn (/users/marif/dev/javascript/javascript-boilerplate/node_modules/grunt/lib/grunt/task.js:82:16)     @ object.<anonymous> (/users/marif/dev/javascript/javascript-boilerplate/node_modules/grunt/lib/util/task.js:301:30)     @ task.runtaskfn (/users/marif/dev/javascript/javascript-boilerplate/node_modules/grunt/lib/util/task.js:251:24)     @ task.<anonymous> (/users/marif/dev/javascript/javascript-boilerplate/node_modules/grunt/lib/util/task.js:300:12)     @ /users/marif/dev/javascript/javascript-boilerplate/node_modules/grunt/lib/util/task.js:227:11     @ process._tickcallback (node.js:355:11) 

grunt task given below:

connect: {     client: {         options: {             // server's port, , folder serve from:             // ex: 'localhost:9000' serve 'client/index.html'             port: 9000,             // change '0.0.0.0' access server outside             hostname: 'localhost',             base: '<%= jsb.app %>',             // custom middleware http server:             // injected javascript reloads page.             middleware: livereloadmiddleware         }     } } 

have tried uninstall , install npm package no luck far.

can please point, missing here?

it seems options.base in middleware function becoming array because have updated npm package grunt-contrib-connect latest 0.10.1.

have change snippet rather:

connect.static(options.base), // make empty directories browsable. connect.directory(options.base) 

it must array , should start working:

connect.static(options.base[0]), // make empty directories browsable. connect.directory(options.base[0]) 

hope helps someone!


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -