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

index.js:201 Uncaught TypeError: Cannot read properties of undefined (reading '_internalRoot') at createDevToolDataObject (index.js:201:1) #177

Open
ofirrifo opened this issue Feb 9, 2023 · 9 comments

Comments

@ofirrifo
Copy link

ofirrifo commented Feb 9, 2023

I just install recoilize to chrome
https://chrome.google.com/webstore/detail/recoilize/jhfmmdhbinleghabnblahfjfalfgidik

and install the npm package "recoilize": "^3.1.6",

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
  <StrictMode>
    <RecoilRoot>
      <RecoilizeDebugger />
      ....SOME OTHE COMPONENTS
    </RecoilRoot>
  </StrictMode>
);

and I get this error:

index.js:201 Uncaught TypeError: Cannot read properties of undefined (reading '_internalRoot')
    at createDevToolDataObject (index.js:201:1)
    at index.js:98:1
    at commitHookEffectListMount (react-dom.development.js:23150:1)
    at commitPassiveMountOnFiber (react-dom.development.js:24926:1)
    at commitPassiveMountEffects_complete (react-dom.development.js:24891:1)
    at commitPassiveMountEffects_begin (react-dom.development.js:24878:1)
    at commitPassiveMountEffects (react-dom.development.js:24866:1)
    at flushPassiveEffectsImpl (react-dom.development.js:27039:1)
    at flushPassiveEffects (react-dom.development.js:26984:1)
    at react-dom.development.js:26769:1

For some reason _reactRootContainer is not define recoilizeRoot._reactRootContainer

  const createDevToolDataObject = (filteredSnapshot, diff, atomsAndSelectors) => {
    if (diff === undefined) {
      return {
        filteredSnapshot: filteredSnapshot,
        componentAtomTree: formatFiberNodes(
          recoilizeRoot._reactRootContainer._internalRoot.current,
        ),
        atomsAndSelectors,
      };
    } else {
      return {
        filteredSnapshot: filteredSnapshot,
        componentAtomTree: formatFiberNodes(
          recoilizeRoot._reactRootContainer._internalRoot.current,
        ),
        indexDiff: diff,
        atomsAndSelectors,
      };
    }
  };
@erickarnis-tb
Copy link

I'm also experiencing this. I was wondering if there is a workaround?

@davit-b
Copy link

davit-b commented Mar 21, 2023

I am also suffering from this issue.

@zbyte64
Copy link

zbyte64 commented Mar 21, 2023

Even passing the root app doesn't work: <RecoilizeDebugger root={root} />

@davit-b
Copy link

davit-b commented Mar 22, 2023

I solved it with this #172 (comment)

It's not great, but better than it just not working at all.

@mawburn
Copy link

mawburn commented Apr 26, 2023

Yeah, unfortunately I don't think that's not an adequate fix for most of us. I was pretty hyped to add it back in today, but let down when I ran into this issue because I was tracking #172 but it didn't solve the problem.

This issue is also tracked here: #165

@davit-b
Copy link

davit-b commented Apr 26, 2023

Yeah, unfortunately I don't think that's not an adequate fix for most of us. I was pretty hyped to add it back in today, but let down when I ran into this issue because I was tracking #172 but it didn't solve the problem.

This issue is also tracked here: #165

@mawburn

I honestly just switched to Jotai. Jotai is atom-based state just like Recoil but with none of the sharp edges...
And it's actively being developed.

@erickarnis-tb
Copy link

I think this library has been abandoned, the last commit was ages ago. Does anyone know of a good alternative?

@mawburn
Copy link

mawburn commented Apr 26, 2023

I honestly just switched to Jotai. Jotai is atom-based state just like Recoil but with none of the sharp edges...
And it's actively being developed.

My team hasn't had any issues with Recoil and it seems to be in active development. Just this helper plugin seems to be abandoned.

Either way, I was just posting to let other people know who are running into this issue.

@erickarnis-tb
Copy link

Sorry, I was referring to this plugin.

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

5 participants