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

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?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 15

Most upvoted comments

this is solved add this in loki.config.js fetchFailIgnore: 'localhost:1234/get|192\\.168\\.29\\.108:6006/runtime-error', Thanks for the help !! really appreciated

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

@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

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