Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React 16, w/ immutableJS #17

Closed
shierro opened this issue Oct 24, 2018 · 3 comments
Closed

React 16, w/ immutableJS #17

shierro opened this issue Oct 24, 2018 · 3 comments

Comments

@shierro
Copy link

shierro commented Oct 24, 2018

Hi, has anyone tested this plugin w/ react 16? I might also ask, are there compatibility issues with redux-offline versions?

I encountered

uncaught at changeOnlineStatus TypeError: Cannot read property 'queue' of undefined
(... on /redux-offline-queue/lib/offlineMiddleware.js?:104:29)

when redux-offline-queue/ONLINE is dispatched

Anyone encountered this issue or might know what caused it?
Thanks in advance!

@RobPando
Copy link
Member

@shierro I have tested this with React 16 and it works fine, I don't know for sure, but there could be compatibility issues with redux-offline perhaps when you create the store, maybe you are missing something in configuring the middleware?

From that error it seems that the library has an undefined state, did you include the offline reducer to your combineReducers?

combineReducers({
   // ... your other reducers here
    offline: require('redux-offline-queue').reducer,
  })

@shierro
Copy link
Author

shierro commented Oct 27, 2018

@RobPando i see, it's nice to know that it works on your end. i triple checked what is provided on README, here's what i have so far (i tried to follow the set-up with redux saga)

Store configuration
https://gist.github.com/shierro/0c9bb943975dadee1da3b32df90552bd

Combined reducers
https://gist.github.com/shierro/88e15fe622e3f8abee2f5bbf5c94fc29

on the combined reducers, i tested both offline and offlineQueue(because it's what's indicated on README), both failed when redux-offline-queue/ONLINE is dispatched

here's the stacktrace

 error      TypeError: Cannot read property 'queue' of undefined
    at eval (offlineMiddleware.js:104)
    at eval (redux-logger.js?d665:1)
    at eval (middleware.js:18)
    at dispatch (redux.js:569)
    at eval (utils.js:283)
    at eval (proc.js:499)
    at exec (scheduler.js:23)
    at flush (scheduler.js:64)
    at asap (scheduler.js:37)
    at Array.eval (channel.js:197)
    at Object.emit (channel.js:38)
    at eval (middleware.js:72)
    at eval (suspendSaga.js:42)
    at eval (offlineMiddleware.js:117)
    at eval (redux-logger.js?d665:1)
    at Object.eval [as dispatch] (middleware.js:18)
    at eval (index.js:132)
    at eval (detectNetwork.js:12)
    at a (helpers.ts:77)

version of tools that i'm using (might help)
"redux-offline-queue": "^1.0.4"
"@redux-offline/redux-offline": "^2.4.0"
"immutable": "3.8.2"
"react": "16.4.2"
"react-redux": "5.0.7"
"redux-offline-immutable-config": "^1.0.0"
"redux": "4.0.0"
"redux-saga": "0.16.0"

@bijuC1983
Copy link

@RobPando I think I am facing a very similar issue #55 . Any help would be truly appreciated and allow us to use this library so wonderfully created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants