Skip to content

TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner') #531

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

Closed
EvgeniyWis opened this issue Dec 27, 2024 · 11 comments
Closed

Comments

@EvgeniyWis
Copy link

EvgeniyWis commented Dec 27, 2024

When running loki I get this error:

D:\FrontEnd\Projects\SuncovRussian\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53        
throw ex;
        ^

TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
    at Object.$$$reconciler [as default] (D:\FrontEnd\Projects\SuncovRussian\node_modules\ink\node_modules\react-reconciler\cjs\react-reconciler.development.js:344:46)
    at Object.<anonymous> (D:\FrontEnd\Projects\SuncovRussian\node_modules\ink\build\reconciler.js:21:45) 
    at Module._compile (node:internal/modules/cjs/loader:1740:14)
    at Object..js (node:internal/modules/cjs/loader:1905:10)
    at Module.load (node:internal/modules/cjs/loader:1474:32)
    at Function._load (node:internal/modules/cjs/loader:1286:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)
    at Module.require (node:internal/modules/cjs/loader:1496:12)
    at require (node:internal/modules/helpers:135:16)

Node.js v23.5.0

I looked at the react-reconciler.development.js file and concluded that the issue is that the react-reconciler library that loki uses uses React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, which is highly discouraged. Does anyone have any idea how this can be affected?

@VytautasEilika
Copy link

VytautasEilika commented Jan 2, 2025

Same problem

/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
    at Object.$$$reconciler [as default] (/home/v/e/node_modules/react-reconciler/cjs/react-reconciler.development.js:344:46)
    at Object.<anonymous> (/home/v/e/node_modules/ink/build/reconciler.js:21:45)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
    at Module.load (node:internal/modules/cjs/loader:1205:32)
    at Module._load (node:internal/modules/cjs/loader:1021:12)
    at Module.require (node:internal/modules/cjs/loader:1230:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/v/e/node_modules/ink/build/ink.js:31:38)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)

Node.js v21.7.3

@EvgeniyWis
Copy link
Author

Same problem

/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
    at Object.$$$reconciler [as default] (/home/v/e/node_modules/react-reconciler/cjs/react-reconciler.development.js:344:46)
    at Object.<anonymous> (/home/v/e/node_modules/ink/build/reconciler.js:21:45)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
    at Module.load (node:internal/modules/cjs/loader:1205:32)
    at Module._load (node:internal/modules/cjs/loader:1021:12)
    at Module.require (node:internal/modules/cjs/loader:1230:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/v/e/node_modules/ink/build/ink.js:31:38)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)

Node.js v21.7.3

Given this response, it seems as if we have no influence on this

@jiroler
Copy link

jiroler commented Feb 13, 2025

I've got the same error after updating react to 19. This fix in package.json works for me:

    "overrides": {
        "ink": {
            "react": "^17.0.2"
        }
    },

The version "^17.0.2" is from @loki/runner package

@EvgeniyWis
Copy link
Author

I've got the same error after updating react to 19. This fix in package.json works for me:

"overrides": {
    "ink": {
        "react": "^17.0.2"
    }
},

The version "^17.0.2" is from @loki/runner package

It doesn`t work for me :(

@jiroler
Copy link

jiroler commented Feb 17, 2025

@EvgeniyWis Do you have the same error?

@EvgeniyWis
Copy link
Author

@EvgeniyWis Do you have the same error?

Yes

@jiroler
Copy link

jiroler commented Feb 17, 2025

@EvgeniyWis You should remove package-lock.json file, node_modules folder, then apply changes and run npm i.
I would take a look at your repo if it is public

@EvgeniyWis
Copy link
Author

EvgeniyWis commented Feb 17, 2025

@EvgeniyWis You should remove package-lock.json file, node_modules folder, then apply changes and run npm i.
I would take a look at your repo if it is public

https://github.com/EvgeniyWis/SuncovRussian - there is my repo

@jiroler
Copy link

jiroler commented Feb 17, 2025

@EvgeniyWis I've made the changes and loki works. There is no ReactCurrentOwner error, but another errors appear.
I think the main goal is achieved - loki fetches stories. The rest is on your end :)
,Image

  "overrides": {
    "ink": {
      "react": "^17.0.2"
    }
  },
  "loki": {
    "configurations": {
      "chrome": {
        "target": "chrome.app",
        "width": 1440,
        "height": 900,
        "deviceScaleFactor": 1,
        "mobile": false
      }
    }
% npx loki test --port 6006 
loki test v0.35.0
(node:41401) NOTE: The AWS SDK for JavaScript (v2) is in maintenance mode.
 SDK releases are limited to address critical bug fixes and security issues only.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the blog post at https://a.co/cUPnyil
(Use `node --trace-warnings ...` to show where the warning was created)
 FAIL  chrome.app/chrome/Features/Test
       With One Correct Answer
       2 requests failed to load; , 
 FAIL  chrome.app/chrome/Features/PartsOfSpeachItem
       Primary
       2 requests failed to load; , 
 FAIL  chrome.app/chrome/Features/Test
       With One Correct Answer
       2 requests failed to load; , 
       With Some Correct Answers
       2 requests failed to load; , 
 FAIL  chrome.app/chrome/Pages/Dictants
       Primary
       3 requests failed to load; , , https://xn----8sbezalrcg2atd4b.xn--p1ai/api/v1/tests
 FAIL  chrome.app/chrome/Pages/Main
       Primary
       3 requests failed to load; , , https://xn----8sbezalrcg2atd4b.xn--p1ai/api/v1/tests
 FAIL  chrome.app/chrome/Entities/TheoryItem
       Primary
       2 requests failed to load; , 
 FAIL  chrome.app/chrome/Pages/NotFound
       Primary
       3 requests failed to load; , , https://xn----8sbezalrcg2atd4b.xn--p1ai/api/v1/tests
 FAIL  chrome.app/chrome/Pages/PartsOfSpeachPage
...

@EvgeniyWis
Copy link
Author

"overrides": {
"ink": {
"react": "^17.0.2"
}
},
"loki": {
"configurations": {
"chrome": {
"target": "chrome.app",
"width": 1440,
"height": 900,
"deviceScaleFactor": 1,
"mobile": false
}
}

Thank you so much! I had to do a lot of manipulations, but your help made an important first step in solving this problem)

@Zaynalobiddin
Copy link

This solution worked for me as well. Thank you @jiroler for the solution, and thank you @EvgeniyWis for quite good describing the issue

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

4 participants