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

Uncaught TypeError: Cannot read properties of undefined (reading 'offsetWidth') #5959

Closed
1 of 7 tasks
ozyx opened this issue Nov 8, 2022 · 5 comments · Fixed by #5960
Closed
1 of 7 tasks

Uncaught TypeError: Cannot read properties of undefined (reading 'offsetWidth') #5959

ozyx opened this issue Nov 8, 2022 · 5 comments · Fixed by #5960
Labels
Milestone

Comments

@ozyx
Copy link
Contributor

ozyx commented Nov 8, 2022

Summary

Uncaught TypeError: Cannot read properties of undefined (reading 'offsetWidth') seen in console during normal use of Open MCT.

Several tests are failing due to this error. The first instance of failure is during this nightly run on 10/12. Likely caused by changes introduced in this commit.

Expected vs Current Behavior

No unhandled TypeErrors

Steps to Reproduce

  1. Create a few sine wave generators
  2. Rapidly switch between them with the debug console open
  3. Observe the aforementioned error in the console

Environment

  • Open MCT Version: 2.1.3
  • Deployment Type: local
  • OS:
  • Browser:

Impact Check List

  • Data loss or misrepresented data?
  • Regression? Did this used to work or has it always been broken?
  • Is there a workaround available?
  • Does this impact a critical component?
  • Is this just a visual bug with no functional impact?
  • Does this block the execution of e2e tests?
  • Does this have an impact on Performance?

Additional Information

@ozyx ozyx added the type:bug label Nov 8, 2022
@scottbell
Copy link
Contributor

This function used to have a guard to protect against a null element. I think we can restructure the function a bit to re-add this:

handleWindowResize() {
            if (this.$parent.$refs.plotWrapper) {
                const newOffsetWidth = this.$parent.$refs.plotWrapper.offsetWidth;
                //we ignore when width gets smaller
                const offsetChange = newOffsetWidth - this.offsetWidth;
                if (offsetChange > OFFSET_THRESHOLD) {
                    this.offsetWidth = newOffsetWidth;
                    this.config.series.models.forEach(this.loadSeriesData, this);
                }
            }
        },

@scottbell scottbell linked a pull request Nov 8, 2022 that will close this issue
15 tasks
@davetsay
Copy link
Contributor

davetsay commented Nov 8, 2022

Whoever works this, please make sure to verify there are no unintended requests going out. Also, specifically, make sure this is true for plots in both eager load tabs and in not eager load tabs.

@scottbell
Copy link
Contributor

Testing instructions to get error:

  • Create 5 sin wave generators at 10Hz
  • Open DevTools Console
  • Flip between them rapidly
  • Observe the error:
Uncaught TypeError: Cannot read properties of undefined (reading 'offsetWidth')
    at VueComponent.handleWindowResize (MctPlot.vue?5bbd:1195:1)
    at invokeFunc (lodash.js?90dc:10401:1)
    at trailingEdge (lodash.js?90dc:10450:1)
    at timerExpired (lodash.js?90dc:10438:1)

@scottbell
Copy link
Contributor

Whoever works this, please make sure to verify there are no unintended requests going out. Also, specifically, make sure this is true for plots in both eager load tabs and in not eager load tabs.

Verified with @davetsay that this works as intended.

@scottbell scottbell self-assigned this Nov 8, 2022
@ozyx ozyx added the unverified label Nov 8, 2022
@unlikelyzero unlikelyzero added this to the Target:2.1.3 milestone Nov 12, 2022
@unlikelyzero unlikelyzero assigned ozyx and unassigned scottbell Nov 12, 2022
@ozyx
Copy link
Contributor Author

ozyx commented Nov 14, 2022

Verified Fixed -- Testathon 11/14/22

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

Successfully merging a pull request may close this issue.

4 participants