Cannot read property 'replaceChild' of null
最近用react做百度一张图,但出现这种错误
【Cannot read property 'replaceChild' of null】VM4845 index.js:6481 Uncaught (in promise) TypeError: Cannot read property 'replaceChild' of null
at Function.replaceChildWithTree (VM4845 index.js:6481)
at Object.dangerouslyReplaceNodeWithMarkup (VM4845 index.js:45907)
at Object.dangerouslyReplaceNodeWithMarkup [as replaceNodeWithMarkup] (VM4845 index.js:11462)
at ReactCompositeComponentWrapper._replaceNodeWithMarkup (VM4845 index.js:50045)
at ReactCompositeComponentWrapper._updateRenderedComponent (VM4845 index.js:50035)
at ReactCompositeComponentWrapper._performComponentUpdate (VM4845 index.js:49985)
at ReactCompositeComponentWrapper.updateComponent (VM4845 index.js:49906)
at ReactCompositeComponentWrapper.performUpdateIfNecessary (VM4845 index.js:49822)
at Object.performUpdateIfNecessary (VM4845 index.js:6394)
at runBatchedUpdates (VM4845 index.js:2656)
at ReactReconcileTransaction.perform (VM4845 index.js:8844)
at ReactUpdatesFlushTransaction.perform (VM4845 index.js:8844)
at ReactUpdatesFlushTransaction.perform (VM4845 index.js:2595)
at Object.flushBatchedUpdates (VM4845 index.js:2678)
at ReactDefaultBatchingStrategyTransaction.closeAll (VM4845 index.js:8910)
at ReactDefaultBatchingStrategyTransaction.perform (VM4845 index.js:8857)
at Object.batchedUpdates (VM4845 index.js:51179)
at Object.enqueueUpdate (VM4845 index.js:2706)
at enqueueUpdate (VM4845 index.js:12055)
at Object.enqueueSetState (VM4845 index.js:12249)
at DynamicComponent.ReactComponent.setState (VM4845 index.js:14866)
at VM4845 index.js:54633
各种搜,各种检查,还是一直报错,后来在做另一个项目的时候发现,是因为在public中的index.html中引用了一个不存在的js文件。。。。
推荐阅读
- Node.js中readline模块实现终端输入
- Java内存泄漏分析系列之二(jstack生成的Thread|Java内存泄漏分析系列之二:jstack生成的Thread Dump日志结构解析)
- 2019-08-16day20总结
- R|R for data Science(六)(readr 进行数据导入)
- performSelectorOnMainThread:withObject:waitUntilDone:参数设置为NO或YES的区别
- cannot|cannot be read or is not a valid ZIP file
- 运行报错Cannot|运行报错Cannot find module '@babel/compat-data/corejs3-shipped-proposals’
- c#中task与thread区别及其使用的方法示例
- 面试官再问你|面试官再问你 ThreadLocal,就这样狠狠 “怼” 回去!
- 【Reading247】战争与和平-托尔斯泰