nickola105
@nickola105
начинающий

О чем говорит ошибка в консоле?

реакт приложение выдает такое сообщение в консоль, даже не знаю куда копать.
ncaught TypeError: Cannot read property 'id' of undefined
    at ProxyComponent.render (index.jsx:44)
    at ProxyComponent.hotComponentRender (react-hot-loader.development.js:620)
    at ProxyComponent.proxiedRender (react-hot-loader.development.js:635)
    at finishClassComponent (react-dom.development.js:13194)
    at updateClassComponent (react-dom.development.js:13156)
    at beginWork (react-dom.development.js:13825)
    at performUnitOfWork (react-dom.development.js:15864)
    at workLoop (react-dom.development.js:15903)
    at HTMLUnknownElement.callCallback (react-dom.development.js:100)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:138)
render @ index.jsx:44
hotComponentRender @ react-hot-loader.development.js:620
proxiedRender @ react-hot-loader.development.js:635
finishClassComponent @ react-dom.development.js:13194
updateClassComponent @ react-dom.development.js:13156
beginWork @ react-dom.development.js:13825
performUnitOfWork @ react-dom.development.js:15864
workLoop @ react-dom.development.js:15903
callCallback @ react-dom.development.js:100
invokeGuardedCallbackDev @ react-dom.development.js:138
invokeGuardedCallback @ react-dom.development.js:187
replayUnitOfWork @ react-dom.development.js:15311
renderRoot @ react-dom.development.js:15963
performWorkOnRoot @ react-dom.development.js:16561
performWork @ react-dom.development.js:16483
performSyncWork @ react-dom.development.js:16455
requestWork @ react-dom.development.js:16355
scheduleWork$1 @ react-dom.development.js:16219
scheduleRootUpdate @ react-dom.development.js:16786
updateContainerAtExpirationTime @ react-dom.development.js:16813
updateContainer @ react-dom.development.js:16840
ReactRoot.render @ react-dom.development.js:17123
(anonymous) @ react-dom.development.js:17263
unbatchedUpdates @ react-dom.development.js:16680
legacyRenderSubtreeIntoContainer @ react-dom.development.js:17259
render @ react-dom.development.js:17318
(anonymous) @ index.jsx:33
(anonymous) @ bundle.js:29841
__webpack_require__ @ bootstrap dc87616f65f45fd1c083:678
fn @ bootstrap dc87616f65f45fd1c083:88
(anonymous) @ bundle.js:12979
__webpack_require__ @ bootstrap dc87616f65f45fd1c083:678
(anonymous) @ bootstrap dc87616f65f45fd1c083:724
(anonymous) @ bootstrap dc87616f65f45fd1c083:724
react-dom.development.js:14227 The above error occurred in the <Component/SlideClub> component:
    in Component/SlideClub (created by recommendedClubs)
    in section (created by recommendedClubs)
    in recommendedClubs (created by Landing)
    in Landing (created by Connect(Landing))
    in Connect(Landing) (created by Route)
    in Route (created by App)
    in Switch (created by App)
    in main (created by Layout)
    in Layout (created by App)
    in App
    in Router (created by BrowserRouter)
    in BrowserRouter
    in Provider

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
logCapturedError @ react-dom.development.js:14227
logError @ react-dom.development.js:14266
update.callback @ react-dom.development.js:14919
callCallback @ react-dom.development.js:10879
commitUpdateQueue @ react-dom.development.js:10923
commitLifeCycles @ react-dom.development.js:14397
commitAllLifeCycles @ react-dom.development.js:15463
callCallback @ react-dom.development.js:100
invokeGuardedCallbackDev @ react-dom.development.js:138
invokeGuardedCallback @ react-dom.development.js:187
commitRoot @ react-dom.development.js:15604
completeRoot @ react-dom.development.js:16619
performWorkOnRoot @ react-dom.development.js:16564
performWork @ react-dom.development.js:16483
performSyncWork @ react-dom.development.js:16455
requestWork @ react-dom.development.js:16355
scheduleWork$1 @ react-dom.development.js:16219
scheduleRootUpdate @ react-dom.development.js:16786
updateContainerAtExpirationTime @ react-dom.development.js:16813
updateContainer @ react-dom.development.js:16840
ReactRoot.render @ react-dom.development.js:17123
(anonymous) @ react-dom.development.js:17263
unbatchedUpdates @ react-dom.development.js:16680
legacyRenderSubtreeIntoContainer @ react-dom.development.js:17259
render @ react-dom.development.js:17318
(anonymous) @ index.jsx:33
(anonymous) @ bundle.js:29841
__webpack_require__ @ bootstrap dc87616f65f45fd1c083:678
fn @ bootstrap dc87616f65f45fd1c083:88
(anonymous) @ bundle.js:12979
__webpack_require__ @ bootstrap dc87616f65f45fd1c083:678
(anonymous) @ bootstrap dc87616f65f45fd1c083:724
(anonymous) @ bootstrap dc87616f65f45fd1c083:724
index.jsx:44 Uncaught TypeError: Cannot read property 'id' of undefined
    at ProxyComponent.render (index.jsx:44)
    at ProxyComponent.hotComponentRender (react-hot-loader.development.js:620)
    at ProxyComponent.proxiedRender (react-hot-loader.development.js:635)
    at finishClassComponent (react-dom.development.js:13194)
    at updateClassComponent (react-dom.development.js:13156)
    at beginWork (react-dom.development.js:13825)
    at performUnitOfWork (react-dom.development.js:15864)
    at workLoop (react-dom.development.js:15903)
    at renderRoot (react-dom.development.js:15943)
    at performWorkOnRoot (react-dom.development.js:16561)

Подскажите мож кто сталкивался
  • Вопрос задан
  • 648 просмотров
Решения вопроса 1
rockon404
@rockon404 Куратор тега React
Frontend Developer
В методе render у вас обращение к свойству id несуществующего объекта. Устраняется ошибка следующими способами:
1. Задавать начальные state/props.
2. Делать проверку на существование объекта перед обращением к его свойству.
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
leni_m
@leni_m
ЧупаКобрус
ncaught TypeError: Cannot read property 'id' of undefined

не могу прочитать id у "ничего"
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы