RDT crashes page if store.subscribe is undefined

Open
#2,075 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
redux, typescript

Research direction

Start at extension/src/pageScript/index.ts around line 498 and inspect how the page script uses store.subscribe. Reproduce the issue with the sample store definition where subscribe is absent, then verify that the page no longer crashes and fails gracefully when the store does not provide that method.

Written by the indexing model from the issue text.

Description

page.bundle.js:6 Uncaught TypeError: t.subscribe is not a function
    at I (page.bundle.js:6:6537)
    at page.bundle.js:6:6935
    at hk (main.jsx-4WfQJ2Z1.js:841:35810)
    at main.jsx-4WfQJ2Z1.js:841:65460

Source code:

https://github.com/reduxjs/redux-devtools/blob/4b1d1d6dbfd79caa28f29b3684cd649a4028652f/extension/src/pageScript/index.ts#L498

Sample store definition from Chrome inspect:

{
   @@observable: ƒ [d]()
   dispatch: ƒ s(c)
   getState: ƒ i()
   liftedStore: ƒ ()
   replaceReducer: ƒ replaceReducer(c)
   [[Prototype]]: Object
}

I think this is because RDT now has a higher Redux version requirement. But it should gracefully fail rather than crash the whole page

Dominant language
TypeScript
Stars
14.4k
Forks
1.2k
Avg merge
3d 6h
Merged PRs (30d)
12

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reduxjs/redux-devtools

All issues in reduxjs/redux-devtools

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.