Cannot read property 'replaceChild' of null

最近用react做百度一张图,但出现这种错误

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文件。。。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值