Skip to content

Uncaught TypeError: Cannot read properties of undefined (reading 'activeElement') #711

@RuellePaul

Description

@RuellePaul

When migrate to Vite 4, I'm getting this error :

Uncaught TypeError: Cannot read properties of undefined (reading 'activeElement')
    at Object.getActiveElement (cleave-react-node.js:2766:37)
    at Object.setSelection (cleave-react-node.js:2741:31)
    at ReactClassComponent.componentDidUpdate (cleave-react-node.js:103:15)
    at commitLifeCycles (react-dom.development.js:20684:24)
    at commitLayoutEffects (react-dom.development.js:23426:7)
    at HTMLUnknownElement.callCallback2 (react-dom.development.js:3945:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:16)
    at invokeGuardedCallback (react-dom.development.js:4056:31)
    at commitRootImpl (react-dom.development.js:23151:9)
    at unstable_runWithPriority (scheduler.development.js:468:12)

I'm using the lib correctly 'cause it worked with CRA.

This code from this cleave-react-node seems involved :

getActiveElement: function getActiveElement(parent) {
   var activeElement = parent.activeElement;
   if (activeElement && activeElement.shadowRoot) {
      return this.getActiveElement(activeElement.shadowRoot);
   }
   return activeElement;
}

Do you have any idea what I can do ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions