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

Error: "Cannot read property 'duration' of undefined" #18798

Closed
shiftyp opened this issue May 1, 2020 · 5 comments · Fixed by #18862
Closed

Error: "Cannot read property 'duration' of undefined" #18798

shiftyp opened this issue May 1, 2020 · 5 comments · Fixed by #18862

Comments

@shiftyp
Copy link

shiftyp commented May 1, 2020

Describe what you were doing when the bug occurred:

  1. Add interaction tracing with unstable_trace
  2. Record a profile, navigate to Profiler > Profiled Interactions
  3. Error appears when scrolling view or immediately

Kapture 2020-05-01 at 8 37 44

Please do not remove the text below this line

DevTools version: 4.6.0-6cceaeb67

Call stack: at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:344360
at Array.map ()
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:344166
at ci (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:59620)
at Ll (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:109960)
at qc (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:102381)
at Hc (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:102306)
at Vc (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:102171)
at Tc (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:98781)
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:46014

Component stack: in Unknown
in Unknown
in div
in div
in n
in div
in bc
in div
in n
in div
in vc
in div
in div
in div
in So
in Unknown
in n
in Unknown
in div
in div
in rl
in Ze
in fn
in Ga
in _s

@chiragswadia
Copy link

Looks like duplicate of #18786 🤔

@shiftyp
Copy link
Author

shiftyp commented May 1, 2020

Here is a deployed repro case: https://react-example1.s3.amazonaws.com/index.html

Steps:

  1. Load above URL
  2. Open React Profiler
  3. Start recording
  4. Hit the "Fetch" button a few times
  5. Stop Recording
  6. navigate to the Profiled Interactions tab
  7. Scroll down to the bottom of the list. The error should occur as you approach the bottom of the view

You can find the code for the case here: https://github.com/shiftyp/object-hooks/blob/experimental-tracing/packages/object-hooks/src/useInstances.ts#L37

@bvaughn
Copy link
Contributor

bvaughn commented May 1, 2020

Thanks for the repro case, @shiftyp!

@bvaughn
Copy link
Contributor

bvaughn commented May 6, 2020

@shiftyp Did you forget to commit something?

Checking out the experimental-tracing branch and running yarn && yarn install && yarn start throws:

Cannot resolve dependency 'object-hooks'

Seems like a problem with the workspace configuration or something?

🚨  ../object-hooks/packages/notebook/src/hooks/useNotebooks.ts:39:29: Cannot resolve dependency 'object-hooks'
    at Resolver.resolve (../object-hooks/node_modules/parcel-bundler/src/Resolver.js:71:17)
    at async Bundler.resolveAsset (../object-hooks/node_modules/parcel-bundler/src/Bundler.js:433:18)
    at async Bundler.resolveDep (../object-hooks/node_modules/parcel-bundler/src/Bundler.js:484:14)
    at async ../object-hooks/node_modules/parcel-bundler/src/Bundler.js:608:26
    at async Promise.all (index 2)
    at async Bundler.loadAsset (../object-hooks/node_modules/parcel-bundler/src/Bundler.js:599:21)
    at async ../object-hooks/node_modules/parcel-bundler/src/Bundler.js:610:13
    at async Promise.all (index 4)
    at async Bundler.loadAsset (../object-hooks/node_modules/parcel-bundler/src/Bundler.js:599:21)
    at async ../object-hooks/node_modules/parcel-bundler/src/Bundler.js:610:13

I was able to run yarn start on master, but that doesn't have the repro.

bvaughn pushed a commit to bvaughn/react that referenced this issue May 7, 2020
We used to filter "empty" DevTools commits, but it was error prone (see facebook#18798). A commit may appear to be empty (no actual durations) because of component filters, but filtering these empty commits causes interaction commit indices to be off by N. This not only corrupts the resulting data, but also potentially causes runtime errors.

For that matter, hiding "empty" commits might cause confusion too. A commit *did happen* even if none of the components the Profiler is showing were involved.
@bvaughn
Copy link
Contributor

bvaughn commented May 8, 2020

Disregard. The remote repro was sufficient.

Thanks for sharing it!

bvaughn pushed a commit that referenced this issue May 8, 2020
* Disable Profiler commit filtering

We used to filter "empty" DevTools commits, but it was error prone (see #18798). A commit may appear to be empty (no actual durations) because of component filters, but filtering these empty commits causes interaction commit indices to be off by N. This not only corrupts the resulting data, but also potentially causes runtime errors.

For that matter, hiding "empty" commits might cause confusion too. A commit *did happen* even if none of the components the Profiler is showing were involved.

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

Successfully merging a pull request may close this issue.

3 participants