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

[Bug]: Telemetry showing Uncaught TypeError: Cannot read properties of null (reading '__keyborg') #33871

Open
2 tasks done
wbarrantes opened this issue Feb 19, 2025 · 1 comment

Comments

@wbarrantes
Copy link
Contributor

Component

Other...

Package version

9.56.8

React version

18.2.0

Environment

This command does not work properly against our configuration: 
       
        "@fluentui/react": "^8.118.8",
        "@fluentui/react-brand-icons": "^1.0.133",
        "@fluentui/react-button": "^9.1.6",
        "@fluentui/react-calendar-compat": "^0.1.12",
        "@fluentui/react-card": "9.0.0-beta.34",
        "@fluentui/react-charting": "^5.17.1",
        "@fluentui/react-components": "^9.55.1",
        "@fluentui/react-datepicker-compat": "^0.4.42",
        "@fluentui/react-file-type-icons": "^8.6.0",
        "@fluentui/react-hooks": "^8.5.0",
        "@fluentui/react-icons": "^2.0.267",
        "@fluentui/react-link": "^9.1.10",
        "@fluentui/react-overflow": "^9.0.0-rc.2",
        "@fluentui/react-portal-compat": "^9.0.100",
        "@fluentui/react-positioning": "^9.9.21",
        "@fluentui/react-provider": "^9.1.5",
        "@fluentui/react-search": "^9.0.6",
        "@fluentui/react-shared-contexts": "^9.1.1",
        "@fluentui/react-tabster": "^9.14.6",
        "@fluentui/react-text": "9.1.8",
        "@fluentui/react-theme": "^9.1.1",
        "@fluentui/react-theme-sass": "^9.0.0-alpha.20",
        "@fluentui/react-timepicker-compat": "^0.2.20",
        "@fluentui/react-utilities": "^9.1.2",
        "@fluentui/react-window-provider": "^2.1.0",
        "@fluentui/style-utilities": "^8.6.0",
        "@fluentui/theme": "^2.4.11",
        "@fluentui/utilities": "^8.13.19",

        "react": "^18.2.0",
        "react-csv": "^2.0.3",
        "react-dom": "^18.2.0",
        "react-easy-crop": "^5.0.8",
        "react-horizontal-scrolling-menu": "0.7.10",
        "react-infinite-scroll-component": "^5.1.0",
        "react-inspector": "^2.2.2",
        "react-redux": "^7.1.0",
        "react-relay": "^18.1.0",
        "react-router": "^6.22.3",
        "react-router-dom": "^6.22.3",
        "react-transition-group": "^4.2.1",
        "react-virtualized-auto-sizer": "^1.0.6",
        "react-vtree": "^2.0.4",
        "react-webcam": "^7.1.1",
        "react-window": "^1.8.7",

Current Behavior

The application is hitting this:

Error Message: Uncaught TypeError: Cannot read properties of null (reading '__keyborg')

Callstack:
TypeError: Cannot read properties of null (reading '__keyborg')
at new e (https://res.public.onecdn.static.microsoft/owamail/hashed-v1/scripts/owa.43710.m.c7edbdb7.js:31:949615)
at e.create (https://res.public.onecdn.static.microsoft/owamail/hashed-v1/scripts/owa.43710.m.c7edbdb7.js:31:949772)
at f (https://res.public.onecdn.static.microsoft/owamail/hashed-v1/scripts/owa.43710.m.c7edbdb7.js:31:950387)
at https://res.public.onecdn.static.microsoft/owamail/hashed-v1/scripts/owa.43710.m.c7edbdb7.js:31:157425
at az (https://res.public.onecdn.static.microsoft/owamail/hashed-v1/scripts/owa.43710.m.c7edbdb7.js:31:1058822)
at sH (https://res.public.onecdn.static.microsoft/owamail/hashed-v1/scripts/owa.43710.m.c7edbdb7.js:31:1087871)
at l (https://res.public.onecdn.static.microsoft/owamail/hashed-v1/scripts/owa.43710.m.c7edbdb7.js:31:1082425)
at S (https://res.public.onecdn.static.microsoft/owamail/hashed-v1/scripts/owa.43710.m.c7edbdb7.js:31:1105138)
at MessagePort.R (https://res.public.onecdn.static.microsoft/owamail/hashed-v1/scripts/owa.43710.m.c7edbdb7.js:31:1105668)

Original Callstack:
webpack://owa/node_modules/keyborg/src/Keyborg.ts __keyborg 297
webpack://owa/node_modules/keyborg/src/Keyborg.ts 279
webpack://owa/node_modules/keyborg/src/Keyborg.ts create 369
webpack://owa/node_modules/@fluentui/react-tabster/lib/hooks/useKeyborgRef.js targetDocument 13
webpack://owa/node_modules/react-dom/cjs/react-dom.production.min.js d 244
webpack://owa/node_modules/react-dom/cjs/react-dom.production.min.js Rj 286
webpack://owa/node_modules/react-dom/cjs/react-dom.production.min.js Ik 282
webpack://owa/node_modules/react-dom/node_modules/scheduler/cjs/scheduler.production.min.js d 13
webpack://owa/node_modules/react-dom/node_modules/scheduler/cjs/scheduler.production.min.js O 14

Expected Behavior

No exception is thrown

Reproduction

https://aka.ms/fluentpen

Steps to reproduce

Only detected by telemetry

Are you reporting an Accessibility issue?

no

Suggested severity

High - No workaround

Products/sites affected

Outlook

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@wbarrantes
Copy link
Contributor Author

I have observed that in useKeyborgRef, a new Keyborg instance is created by passing the defaultView from the targetDocument. There might be instances where the document is not associated with a window (e.g., an offscreen document). In such cases, defaultView can be null, and I do not see checks for this scenario in Keyborg.

@ling1726 @mshoho — This may or may not be related to the issue we are encountering, but please let me know if this observation is relevant.

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

No branches or pull requests

2 participants