YahooArchive / fluxible-router

MOVED TO FLUXIBLE REPO
104 stars 26 forks source link

Warning generated by router when routing to a page with list #25

Closed geekyme closed 9 years ago

geekyme commented 9 years ago

I got this warning when I navigate using <NavLink /> to a route with a list. No idea how to debug this. It does not happen on server side rendering. only on client side rendering when transiting routes.

iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. Error
    at src_Map__Map.Object.defineProperty.get (webpack:///./~/fluxible-router/~/immutable/dist/immutable.js?:4584:21)
    at eval (webpack:///./~/lodash/internal/createBaseEach.js?:14:41)
    at Object.eval [as forEach] (webpack:///./~/lodash/internal/createForEach.js?:16:9)
    at Object.Fetcher._defaultConstructGetUri (webpack:///./~/fluxible-plugin-fetchr/~/fetchr/libs/fetcher.client.js?:301:20)
    at Object.Fetcher.single (webpack:///./~/fluxible-plugin-fetchr/~/fetchr/libs/fetcher.client.js?:390:36)
    at Object.Fetcher._sync (webpack:///./~/fluxible-plugin-fetchr/~/fetchr/libs/fetcher.client.js?:264:22)
    at Object.Fetcher.read (webpack:///./~/fluxible-plugin-fetchr/~/fetchr/libs/fetcher.client.js?:200:18)
    at Object.crudProxyMethod [as read] (webpack:///./~/fluxible-plugin-fetchr/lib/fetchr-plugin.js?:38:28)
    at getActivities (webpack:///./src/actions/activity-action-creators.js?:22:21)
    at executeActionInternal (webpack:///./~/fluxible/lib/FluxibleContext.js?:166:18)
    at eval (webpack:///./~/fluxible/lib/FluxibleContext.js?:133:17)
    at Array.onNextTick (webpack:///(webpack)/~/node-libs-browser/~/timers-browserify/main.js?:64:12)
    at drainQueue (webpack:///(webpack)/~/node-libs-browser/~/process/browser.js?:19:28)
mridgway commented 9 years ago

Sorry, for the delay in responding. Can you elaborate on what you mean a route with a list?

The stack trace includes fetcher.client.js. Are you trying to pass an immutable object to a service.read by any chance? It may be that fetchr is trying to serialize the immutable object. If this is the case, you should pass myObject.toJS() to the service call instead.

geekyme commented 9 years ago

I've managed to fix the issue thanks to your pointers.

The action I was calling in route.js for this particular route was getActivities and it was passed the route immutable object as in the data parameter.

I was passing the entire route object into context.service.read() which triggered that warning. :S

Anyways I realized that if I'm on the route /activity/, and I click the route that links to /activity/ again, the route action actually triggers despite no changes in the route.