react: [DevTools Bug]: "Message length exceeded maximum allowed length" when profiling a complex application

Website or app

N/A

Repro steps

When profiling a complex, proprietary app, I regularly get an error message, “Message length exceeded maximum allowed length.”

Steps to reproduce:

  1. Within the Dev Tools, go to the Profiler tab.
  2. Click the “Start Profiling” button.
  3. Let the app run for a bit. Do some things in the app.
  4. Click the “Stop Profiling” (“record”) button.

At this point, the Chrome Dev Tools console logs an error:

contentScript.js:116 Uncaught Error: Message length exceeded maximum allowed length.
    at handleMessageFromPage (contentScript.js:116:10)

And the Profiler tab is stuck with the message, “Processing data… This should only take a minute.”

The error is thrown from https://github.com/facebook/react/blob/64fe791be84ad04a4a1d005376ba5cf5701db9b7/packages/react-devtools-extensions/src/contentScript.js#L36

The last time this occurred, when breaking on exceptions at that line, JSON.stringify(event.data.payload).length reports 92074565. I can provide further information on the contents of the problematic event.data.payload if that would be helpful.

I apologize for the lack of a reproducible test case - it’s a complex app (which is why I was looking into profiling), and I don’t think I could simplify it down to a public test case while triggering the error.

How often does this bug happen?

Often

DevTools package (automated)

No response

DevTools version (automated)

No response

Error message (automated)

No response

Error call stack (automated)

No response

Error component stack (automated)

No response

GitHub query string (automated)

No response

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 27
  • Comments: 21

Commits related to this issue

Most upvoted comments

I had the same issue in my program. In case it is useful to anyone: it turned out to be caused by a few runaway useEffects in my code that were constantly updating.

That’s the whole reason I’m profiling in the first place! This is quite a catch-22 situation, lol

Looks like it’s a chrome/chromium specific issue (Message length exceeded maximum allowed length). I tried profiling using React DevTools in Firefox and didn’t face this.

@PiTiLeZarD @fgatti675 are either of you able to share a reproducible example?

Hi, we face this issue when debugging FireCMS. It is a fairly large project. It is all open source and can be run locally: https://github.com/firecmsco/firecms

If you would like to give it a try, running it should be as simple as yarn and yarn dev

Got the same issue, any updates? Is there a workaround?