iamshaunjp / Complete-React-Tutorial

All course files for the Complete React Tutorial on the Net Ninja YouTube channel.
1.81k stars 1.72k forks source link

cannot destructure the data object #31

Open payalmit opened 1 year ago

payalmit commented 1 year ago

image

Uncaught runtime errors: × ERROR Cannot destructure property 'data' of '(0 , _useFetchWEBPACK_IMPORTED_MODULE_2__.default)(...)' as it is null. TypeError: Cannot destructure property 'data' of '(0 , _useFetchWEBPACK_IMPORTED_MODULE_2.default)(...)' as it is null. at Home (http://localhost:3000/main.cc6b4c03545d80ef5a52.hot-update.js:72:11) at renderWithHooks (http://localhost:3000/static/js/bundle.js:21462:22) at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:24748:17) at beginWork (http://localhost:3000/static/js/bundle.js:26044:20) at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:11054:18) at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:11098:20) at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:11155:35) at beginWork$1 (http://localhost:3000/static/js/bundle.js:31029:11) at performUnitOfWork (http://localhost:3000/static/js/bundle.js:30276:16) at workLoopSync (http://localhost:3000/static/js/bundle.js:30199:9) ERROR Cannot destructure property 'data' of '(0 , _useFetch__WEBPACK_IMPORTED_MODULE_2.default)(...)' as it is null. TypeError: Cannot destructure property 'data' of '(0 , _useFetchWEBPACK_IMPORTED_MODULE_2__.default)(...)' as it is null. at Home (http://localhost:3000/main.cc6b4c03545d80ef5a52.hot-update.js:72:11) at renderWithHooks (http://localhost:3000/static/js/bundle.js:21462:22) at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:24748:17) at beginWork (http://localhost:3000/static/js/bundle.js:26044:20) at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:11054:18) at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:11098:20) at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:11155:35) at beginWork$1 (http://localhost:3000/static/js/bundle.js:31029:11) at performUnitOfWork (http://localhost:3000/static/js/bundle.js:30276:16) at workLoopSync (http://localhost:3000/static/js/bundle.js:30199:9) ERROR Cannot destructure property 'data' of '(0 , _useFetchWEBPACK_IMPORTED_MODULE_2.default)(...)' as it is null. TypeError: Cannot destructure property 'data' of '(0 , _useFetch__WEBPACK_IMPORTED_MODULE_2.default)(...)' as it is null. at Home (http://localhost:3000/main.cc6b4c03545d80ef5a52.hot-update.js:72:11)

how to solve this error

Azfar-Tariq commented 1 year ago

Can you show you code? I followed the tutorial and mine worked perfectly.