markdalgleish / redial

Universal data fetching and route lifecycle management for React etc.
1.1k stars 42 forks source link

Error with require.ensure #4

Closed luandro closed 8 years ago

luandro commented 8 years ago

I've been using RR's Dynamic Routing technique that uses require.ensure. When doing that I get TypeError: Cannot read property 'fetchers' of undefined, since it's not what makeGetter is expecting:

module.exports = {
    path: '/',
    getComponent(location, cb) {
        require.ensure([], (require) => {
          cb(null, require('./containers/HomeContainer'))
        })
    }
}

I haven't given this much thought, just throwing it out there but it does make sense to do a prefetch on "gradual matched" routes, right?

markdalgleish commented 8 years ago

This should be fixed in v0.4.1. Please re-open if that's not the case.