inferno-devtools with mobx crash app
Uncaught TypeError: Cannot read property '_renderedComponent' of undefined
at visitNonCompositeChildren (inferno-webpack\node_modules\inferno-devtools\dist\index.cjs.js:361)
at Object.componentUpdated (inferno-webpack\node_modules\inferno-devtools\dist\index.cjs.js:179)
at Object.inferno.options.afterUpdate (inferno-webpack\node_modules\inferno-devtools\dist\index.cjs.js:461)
at updateClassComponent (inferno-webpack\node_modules\inferno\dist\index.cjs.js:1833)
at applyState (inferno-webpack\node_modules\inferno\dist\index.cjs.js:2337)
at _a.forceUpdate (inferno-webpack\node_modules\inferno\dist\index.cjs.js:2383)
at Reaction.onInvalidate (inferno-webpack\node_modules\inferno-mobx\dist\index.cjs.js:185)
at Reaction.runReaction (inferno-webpack\node_modules\mobx\lib\mobx.js:3430)
at runReactionsHelper (inferno-webpack\node_modules\mobx\lib\mobx.js:3550)
at reactionScheduler (inferno-webpack\node_modules\mobx\lib\mobx.js:3528)
visitNonCompositeChildren @ inferno-webpack\node_modules\inferno-devtools\dist\index.cjs.js:361
componentUpdated @ inferno-webpack\node_modules\inferno-devtools\dist\index.cjs.js:179
inferno.options.afterUpdate @ inferno-webpack\node_modules\inferno-devtools\dist\index.cjs.js:461
updateClassComponent @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1833
applyState @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:2337
forceUpdate @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:2383
(anonymous) @ inferno-webpack\node_modules\inferno-mobx\dist\index.cjs.js:185
Reaction.runReaction @ inferno-webpack\node_modules\mobx\lib\mobx.js:3430
runReactionsHelper @ inferno-webpack\node_modules\mobx\lib\mobx.js:3550
reactionScheduler @ inferno-webpack\node_modules\mobx\lib\mobx.js:3528
runReactions @ inferno-webpack\node_modules\mobx\lib\mobx.js:3533
endBatch @ inferno-webpack\node_modules\mobx\lib\mobx.js:2990
endAction @ inferno-webpack\node_modules\mobx\lib\mobx.js:231
executeAction @ inferno-webpack\node_modules\mobx\lib\mobx.js:199
res @ inferno-webpack\node_modules\mobx\lib\mobx.js:188
Home @ home.js?6778:55
createClassComponentInstance @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1180
mountComponent @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1348
mount @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1261
mountComponent @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1349
mount @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1261
mountComponent @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1349
mount @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1261
mountArrayChildren @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1339
mountElement @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1317
mount @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1258
mountArrayChildren @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1339
mountElement @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1317
mount @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1258
mountComponent @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1349
mount @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1261
mountComponent @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1349
mount @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1261
mountComponent @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1349
mount @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:1261
render @ inferno-webpack\node_modules\inferno\dist\index.cjs.js:2216
configureAndRender @ index.js?8d54:25
Without mobx usage inferno-devtools works as expected.
"inferno": "^5.0.2",
"inferno-component": "^5.0.2",
"inferno-devtools": "^5.0.2",
"inferno-mobx": "^5.0.2",
"inferno-router": "^5.0.2",
"babel-plugin-inferno": "^5.0.1",
"mobx": "^4.1.1",
"webpack": "3.11.0"
windows 10 x64, nodejs v8.9.4
@Lordiuz Would you like to take a look at this issue? Inferno-devtools has not been tested properly for a long time.
I got the same error without using mobx, but with the devtools.
It seems that preact had the same problem (at least the same error messge in the same function) and fixed it here: https://github.com/developit/preact/pull/988/files
Apparently both preact and inferno devtools both use the same visitNonCompositeChildren function.
Nice catch, thank you. It work fine for me.
@Lordiuz What worked for you? Has the issue been fixed?
Same issue, not related to mobx specifically (I'm using redux) - fix is quite simple, as linked by @cookiecavekeeper - should we submit a PR?
I'm rewriting whole dev tools integration, it will be much better than old one. It will be released hopefully this weekend.