Closed ben-ng closed 11 years ago
Seeing the same issues using Geddy 0.9.10
Yeah, this is holding up a deploy for at least one project that I know of. Any chance we could see a fix soon?
So it looks like at lib/router.coffee:135
Barista is calling apply with a string as the thisArg so the .test
method is undefined.
Found the issue, not sure what the fix is.
In the router.js, the all method
Router.prototype.all = function(path, method) {
var params, ret, route, _i, _len, _ref;
ret = [];
params = false;
_ref = this.routes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
route = _ref[_i];
params = route.parse.apply(path, arguments);
if (params) {
ret.push(params);
}
}
return ret;
};
The route.parse.apply is getting passed in path, not route. The coffee script here is
all: ( path, method )->
ret = []
params = false
for route in @routes
params = route.parse.apply path, arguments
if params
ret.push params
ret
So my guess is the route.parse.apply path, arguments
should be route.parse.apply route, argument
I'm forking and sending a fix in shortly.
@rtgibbons Does this work for you locally?
Yeah, just said that in the PR. You can make the change in the node_modules in router.js on line 82
@Techwraith just update the package.json to use my commit, the issue is fixed with that change
@larzconwell does your fix it also?
@rtgibbons Yeah it does, I didn't notice you had already made a PR!
@larzconwell I like yours better; please keep it, I'm about to remove mine.
@rtgibbons Alright will do
FYI, this should of been a minor or major release not a patch version
Holy crap, sorry guys. Will be at a computer to push a new release in about 20 min
For those that are being held up by a release, run npm shrinkwrap
and then go in and edit to so barista is locked in at 0.0.9
Then remove the node_modules (or the directory with barista in there). And then run npm install. It will use the old version at this point
Ha, or just wait 20 minutes for @kieran to push an update :)
@kieran It's cool thanks!
ok, re-published v0.0.10 with the offending commit reverted, you should be good to deploy now.
Just realized there's a PR that does exactly that and adds test coverage, but github can't merge it for some reason. Will try to do it on the command line.
@rtgibbons Thanks for the reminder re: semver. I didn't mean for there to be an API change, so should this technically not be the correct level of versioning? I'm newish to semver-ing.
I would have bumped a minor version on this. The idea is
MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes.
I would of allied this a functionality change in a backwards-compatible manner. The API didn't change, but it wasn't bug fixes either; it was a re-write of the entire code base in a backwards compatible manner.
Thanks for getting this taken care of. We all appreciate it.
Looks like I've been fucking this up on most releases! Thanks :-)
Here is the stack trace of the error when trying to access a static file in Geddy: