fix agent detection bug: TypeError: Object Mac OS X 10.8.2 has no method 'match' #376

Merged
merged 1 commit into from Jan 12, 2013

Conversation

Projects
None yet
6 participants
Contributor

svasva commented Jan 11, 2013

fix exception:
TypeError: Object Mac OS X 10.8.2 has no method 'match'
    at Object.Tower.MiddlewareAgent as handle

@svasva svasva Update packages/tower-middleware/server/agent.coffee
fix exception:
TypeError: Object Mac OS X 10.8.2 has no method 'match'
    at Object.Tower.MiddlewareAgent [as handle] (/home/erundook/towertest/node_modules/tower/packages/tower-middleware/server/agent.coffee:14:23)
1651cb0

lancejpollard merged commit a6a6bd9 into tower:master Jan 12, 2013

svasva deleted the unknown repository branch Jan 12, 2013

This fixed for me too. When will a new release with this fix be released? I just manually edited my local install for now.

Contributor

svasva commented Jan 21, 2013

you can set npm to use the git-master package, like this (in package.json):

{
...
    "tower": "git://github.com/viatropos/tower.git",
...
}

@erundook thanks I was trying to figure out how to do that!

@jisaacks - once you fixed it in your local installation, how did you get that change to be picked up by your server? I made the same change, and I get the same error. I also put a console.log in that function, and I didn't see the console.log output. Then I put in some very obviously syntactically incorrect garbage, and it didn't fail on that either, which leads me to believe there's some sort of compilation step required to get that change picked up.

@juanpaco I don't recall doing anything except restarting the server.

Well shucks, okay. Thanks for the reply.

I blew away my node_modules directory and then pointed the packages at the git-master package, so I'm up and running again.

Can someone please explain how to fix this error in detail? I've spent the past hour trying to figure it out.
@erundook @juanpaco @jisaacks @viatropos

@rwwagner90 In your project, go to node_modules/tower/lib/tower-middleware/server/agent.js and replace lines 13-15 with:

mac: !!agent.os.family.match(/mac/i),
windows: !!agent.os.family.match(/win/i),
linux: !!agent.os.family.match(/linux/i)

or as @juanpaco suggested, delete your node_modules directory (in your project), update your package.json file to point to "git://github.com/viatropos/tower.git" instead of a specific version of tower, then run npm install from within your project's directory in terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment