baseprime / grapnel

The smallest JavaScript router with named parameters, HTML5 pushState, and middleware support
http://grapnel.js.org
467 stars 40 forks source link

Bug in latest release #55

Closed ilearnio closed 8 years ago

ilearnio commented 8 years ago

I'm using isomorphic routing with Grapnel and grapnel-server which was working great. After I upgraded to Grapnel v0.6.3 (from 0.6.2) my pages stopped to respond. At first, I thought there was a bug in my code, so I started to debug and found the real cause of the problem.

In you last commit https://github.com/bytecipher/grapnel/commit/5a838d4f03c681439b970ec57589513e41a4b5e1 you changed a lot of functionality in grapnel.js, that eventually broke grapnel-server.

The wareShouldRun function is now accepting wrong data https://github.com/bytecipher/grapnel/blob/server-router/index.js#L122. In previous version, the req attribute was holding the entire connect's request (a huge object), and here's how it looks now:

{ params: {},
keys: [],
matches: [],
match: [ '/admin/users', index: 0, input: '/admin/users' ] }

So the page now hangs, because req.method is always undefined. The res object is now also became quite a srinked.

Hope this info will be helpful to you.

baseprime commented 8 years ago

@ilearnio This is because of the version mismatch in package.json. Try using grapnel-server@0.2.3, it should have this fix.

Thanks! :+1: