Redux-devtools: Support Redux v4

Created on 27 Dec 2017  路  10Comments  路  Source: reduxjs/redux-devtools

There are some breaking changes in Redux v4 that needs to be adressed here.

Using the 4.0.0-beta.1 release results in the following error:

Uncaught TypeError: Cannot read property 'state' of undefined
    at unliftState (instrument.js:579)

It is caused by this change which appends a random string to the initial redux action type. But here in the store enhancher we assume that the inital action is called @@redux/INIT

Most helpful comment

I'm using this code snippet right now which makes it work again - at least a bit:

// tslint:disable:no-var-requires
const reduxModule = require('redux');
reduxModule.__DO_NOT_USE__ActionTypes.INIT = '@@redux/INIT';
reduxModule.__DO_NOT_USE__ActionTypes.REPLACE = '@@redux/REPLACE';

All 10 comments

I can confirm, current version is not compatible with version 4.

I'm using this code snippet right now which makes it work again - at least a bit:

// tslint:disable:no-var-requires
const reduxModule = require('redux');
reduxModule.__DO_NOT_USE__ActionTypes.INIT = '@@redux/INIT';
reduxModule.__DO_NOT_USE__ActionTypes.REPLACE = '@@redux/REPLACE';

There is a PR solving this upstream problem at https://github.com/zalmoxisus/redux-devtools-instrument/pull/17. Now what we need is patience.

Published [email protected]. I think we don't need to increase redux-devtools version as well for this.

Will this fix also apply to redux-devtools-extension? Is there anything we can do to use the latest changes?

Should be fixed in 2.15.2.

@zalmoxisus is there going to be a fix for redux-devtools-extension?

It's been just under a year since last commit to that repo; has it been depreciated or moved?

For anyone still having this problem, note that as of Jan 17, 2019, npm only has redux-devtools-extension v2.13.7 published. So if you want the Redux 4 fix you can't get it directly from the npm repo!

@mmakrzem there's a confusion here with redux-devtools-extension and redux-devtools. Both have the latest version published on npm.

@zalmoxisus I don't understand your comment. I'm building an Electron application that uses Redux 4. I have installed https://www.npmjs.com/package/electron-devtools-installer so that Electron's devTools has a Redux tab, but the tab remains empty. To get it to populate, I needed to use redux-devtools-extension, but the version published on npm is only 2.13.7 which doesn't support redux 4. If the published version of redux-devtools-extension gets updated in npm to the latest version (https://github.com/zalmoxisus/redux-devtools-extension/releases) then my problem would be solved I think. See https://github.com/zalmoxisus/redux-devtools-extension/issues/632

Was this page helpful?
0 / 5 - 0 ratings