DEV Community

Rosy Shrestha
Rosy Shrestha

Posted on

2

Debugging in React + Redux chrome extension

Often, the basic setup for Redux DevTools Extension is not enough. I ran into this problem while trying to debug a redux store in my chrome extension. Here are the steps I followed to address this problem:

Step 1: Follow instructions from here to install the Redux Dev Tools chrome extension.

npm install -- save-dev remote-redux-devtools
or
yarn add remote-redux-devtools --dev
Enter fullscreen mode Exit fullscreen mode

Step 2: Assuming a basic store set up without any sort of middlewares, configure your project to use it.

import { createStore } from 'redux';
import devToolsEnhancer from 'remote-redux-devtools';

import rootReducer from './reducers';

const store = createStore(rootReducer, devToolsEnhancer());

export default store;
Enter fullscreen mode Exit fullscreen mode

Now we’re ready to debug.


Open extension popup by clicking on its icon. Right-click on the opened extension window and choose Inspect. This will open Chrome Developers Tools and will keep your extension window open until you close the devtools.

image1

Right-click on the extension window again and choose Open Remote DevTools under Redux DevTools.

guide

This will open Remote Dev Tools that will connect to your Redux store in a moment.

redux store

Now you’re ready to debug 😊👏.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay