Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable timeout for initializing the extension? #51

Closed
jrnail23 opened this issue Aug 30, 2018 · 16 comments
Closed

Configurable timeout for initializing the extension? #51

jrnail23 opened this issue Aug 30, 2018 · 16 comments

Comments

@jrnail23
Copy link

Hi, I'm trying to get the chrome extension working, but it keeps telling me this:

An error occurred while collecting the measures. This is possibly due to
absence of register observer hook in your project. See the detailed documentation on how to register a top level observer in your React application.

your project is not using React.
If above solutions don't work, then try reloading the plugin or close and reopen the inspected window.

I have installed the observer hook, and I definitely am using React, but my app does take a ridiculously long time to load (one of the reasons we need a good react profiler so badly!), so I suspect your extension's initialization may be timing out before my app is loaded. If that is the case, perhaps you could make that timeout configurable?

@nitin42
Copy link
Owner

nitin42 commented Aug 30, 2018

Oops! Sorry for that. I am going to work on the next release that will hopefully fix this issue.

@nitin42
Copy link
Owner

nitin42 commented Aug 30, 2018

Heya, I've released a new version of the observer hook.

Install the new beta with

Configure the timeout value like this -

registerObserver({ timeout: desire_value_in_number })

Let me know if it works and then I'll go ahead and update the docs.

@jrnail23
Copy link
Author

Wow @nitin42, that was ridiculously fast. I'll give it a shot!

@nitin42
Copy link
Owner

nitin42 commented Aug 30, 2018

Did you got it working with the new beta release ?

@jrnail23
Copy link
Author

finally about to try it, @nitin42. I'll let you know ASAP

@nitin42
Copy link
Owner

nitin42 commented Aug 30, 2018

Awesome!

@jrnail23
Copy link
Author

jrnail23 commented Aug 30, 2018

@nitin42, I just tried it with the Chrome extension (v5.5), and it's still doing the same thing. I set a timeout of 30000, but the extension still gives me the same error message above after only about 2 seconds.
It is capturing state in __REACT_PERF_DEVTOOL_GLOBAL_STORE__, though, and I see the timeout value in that state

@nitin42
Copy link
Owner

nitin42 commented Aug 30, 2018

Hm... Strange! Can you show me a screenshot where you are using the observer hook ?

@nitin42
Copy link
Owner

nitin42 commented Aug 30, 2018

Also, if it gives the error after two sec. then I am sure you must be using [email protected] and not @3.1.8-beta.2!

@nitin42
Copy link
Owner

nitin42 commented Aug 30, 2018

It's perfectly working... see this video where I am using the current beta on my machine. I am adjusting the timeout value that directly impacts the initialisation process - video source

Please make sure that you've [email protected] installed!

@jrnail23
Copy link
Author

I'll doublecheck and get back to you ASAP

@jrnail23
Copy link
Author

jrnail23 commented Aug 30, 2018

@nitin42:

screen shot 2018-08-30 at 5 17 32 pm

invoking the observer hook in my app.js, right before we first render to ReactDOM:
screen shot 2018-08-30 at 5 21 28 pm

The error message, plus console output showing registerObserver was reached:
screen shot 2018-08-30 at 5 22 52 pm

screen shot 2018-08-30 at 5 29 28 pm

Is it possible I don't have the right version of the chrome extension? (I have v5.5 installed)

@nitin42
Copy link
Owner

nitin42 commented Aug 31, 2018

Strange! Are you doing server side rendering or using any server side React framework ?

@nitin42
Copy link
Owner

nitin42 commented Aug 31, 2018

I've released a stable version registerObserver hook i.e [email protected]

I've thoroughly tested the build on three of my websites and apps built with React and I can confirm that everything is working fine.

Closing this issue since the new release adds the timeout value property. But if still there is any issue, feel free to open it.

@nitin42 nitin42 closed this as completed Aug 31, 2018
@jrnail23
Copy link
Author

jrnail23 commented Aug 31, 2018

@nitin42, we're definitely not doing any server-side rendering. Perhaps we're doing something else that the tool doesn't like. What are the general assumptions that the tool expects?

Perhaps my problem isn't actually related to the timeout -- it could be a different error condition, but it doesn't look like I have a way to see the errors. Perhaps you can log errors to the console (or have an option to enable console error logging)

@agandra
Copy link

agandra commented Sep 5, 2018

@nitin42 I am having the same issue as @jrnail23 . Sometimes the devtools waits the full timeout length before showing me the performance statistics. Othertimes, it does not wait the timeout length and just shows the error message. It appears to work inconsistently.

I am not doing server side rendering or using any server side React framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants