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

[2.0.0-beta.19 and later] Redux example fails with redux-devtools installed #1003

Closed
Zaiban opened this issue Feb 5, 2017 · 4 comments
Closed

Comments

@Zaiban
Copy link

Zaiban commented Feb 5, 2017

When using redux-devtools with 2.0 beta 19 or newer, the app fails with a message TypeError: Cannot read property 'position' of undefined. All previous versions of Next work with no problems.

Minimal reproduction from with-redux repo with DevTools added:
https://github.com/Zaiban/next-redux-devtools-test

@timneutkens
Copy link
Member

@Zaiban Would it be an option to use this:
https://github.com/zalmoxisus/redux-devtools-extension

Change your initStore to:

export const initStore = (reducer, initialState, isServer) => {
  if (isServer && typeof window === 'undefined') {
    return createStore(reducer, initialState, applyMiddleware(thunkMiddleware))
  } else {
    if (!store) {
      store = createStore(reducer, initialState, compose(applyMiddleware(thunkMiddleware), window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()))
    }
    return store
  }
}

@timneutkens
Copy link
Member

Closing this for now. Feel free to re-open if needed.

@Zaiban
Copy link
Author

Zaiban commented Mar 2, 2017

I'm aware of the browser plugin, however it is not supported besides FF and Chrome and I have to test on a lot of browsers. Besides that, installing a plugin for every browser just to use the devtools is a pain in the ass while the integrated version just works with no additional work. I do not have enough time at the moment to research this issue further so I leave it closed for now and just disable devtools in my app completely. I will reopen this when I have some spare time to research how to get it working.

@Zaiban
Copy link
Author

Zaiban commented Mar 13, 2017

The culprit behind to this seems to be 8b94534 from #856

Reverting patch-react back to
https://raw.githubusercontent.com/zeit/next.js/cec8f9dd58f125110ea067676b493f2632cf7247/client/patch-react.js
fixes the issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants