5

I am using yeoman's angular generator for my AngularJS app. This generator includes grunt and grunt-contrib-connect, which are very useful... but the dependencies are outdated, so I decided to update those.

When doing so, I have an error for grunt-contrib-connect, here it is when I use the --verbose option:

Running "connect:test" (connect) task
Verifying property connect.test exists in config...OK
File: [no files]
Options: protocol="http", port=9001, hostname="localhost", base=".", directory=null, 
keepalive=false, debug=false, livereload=35729, open=false, useAvailablePort=false, 
onCreateServer=null, middleware=undefined
Warning: undefined is not a function Use --force to continue.

Aborted due to warnings.

So it seems that the middleware is responsible for this issue, here it is:

middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }

Any assistance to help me figuring this out is more than welcome :)

Nicolas
  • 75
  • 9
  • I have the same problem, unsolved so far. FWIW, I don't think `middleware=undefined` is the problem, though, because I see the same in a project where grunt connect works. – user1338062 Oct 12 '15 at 06:35

1 Answers1

0

Using grunt-contrib-connect version 0.10.1 seemed to solve this issue for me. Issue 161 may be related.

user1338062
  • 11,939
  • 3
  • 73
  • 67