Skip to content

CRA: Fast Refresh breaks embedded DevTools backend #20377

Open
@alexanderhupfer

Description

`TypeError: undefined is not a function (near '...e.sub...')
(anonymous function)
src/backend/index.js:26
23 | // DevTools didn't get injected into this page (maybe b'c of the contentType).
24 | return () => {};
25 | }

26 | const subs = [
| ^ 27 | hook.sub(
28 | 'renderer-attached',
29 | ({
View compiled
(anonymous function)
src/backend.js:179
176 | hook.emit('shutdown');
177 | });
178 |
179 | initBackend(hook, agent, window);
| ^ 180 |
181 | // Setup React Native style editor if the environment supports it.
182 | if (resolveRNStyle != null || hook.resolveRNStyle != null) {`
React version:

Steps To Reproduce

  1. create-react-app
  2. yarn add react-devtools
  3. in index.js add import 'react-devtools' on first line
  4. start react-devtools
  5. start create-react-app devserver
  6. go to localhost:3000
  7. crash

Link to code example:

add react-devtools on first line of vanilla 'create-react-app'

The current behavior

devtools

The expected behavior

Debug-Session

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions