Closed sajadhn1988 closed 11 months ago
Unexpected Application Error! Cannot read properties of undefined (reading 'length') TypeError: Cannot read properties of undefined (reading 'length') at Header (http://localhost:3000/static/js/bundle.js:680:51) at renderWithHooks (http://localhost:3000/static/js/bundle.js:52269:22) at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:55555:17) at beginWork (http://localhost:3000/static/js/bundle.js:56851:20) at beginWork$1 (http://localhost:3000/static/js/bundle.js:61814:18) at performUnitOfWork (http://localhost:3000/static/js/bundle.js:61083:16) at workLoopSync (http://localhost:3000/static/js/bundle.js:61006:9) at renderRootSync (http://localhost:3000/static/js/bundle.js:60979:11) at recoverFromConcurrentError (http://localhost:3000/static/js/bundle.js:60471:24) at performConcurrentWorkOnRoot (http://localhost:3000/static/js/bundle.js:60383:26) ๐ฟ Hey developer ๐
You can provide a way better UX than this when your app throws errors by providing your own ErrorBoundary or errorElement prop on your route.
consider the following: cartItems && cartItems.length === 0
Hi @sajadhn1988 Are you a student of Brads? If so can you post in the course Q&A or over on Brads Discord server please, make sure to include a link to your projects repository. If you're not a student then can you tell me if this is using the repository code or your own project?
Closing due to lack of information and not able to reproduce using repository code.
Unexpected Application Error! Cannot read properties of undefined (reading 'length') TypeError: Cannot read properties of undefined (reading 'length') at Header (http://localhost:3000/static/js/bundle.js:680:51) at renderWithHooks (http://localhost:3000/static/js/bundle.js:52269:22) at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:55555:17) at beginWork (http://localhost:3000/static/js/bundle.js:56851:20) at beginWork$1 (http://localhost:3000/static/js/bundle.js:61814:18) at performUnitOfWork (http://localhost:3000/static/js/bundle.js:61083:16) at workLoopSync (http://localhost:3000/static/js/bundle.js:61006:9) at renderRootSync (http://localhost:3000/static/js/bundle.js:60979:11) at recoverFromConcurrentError (http://localhost:3000/static/js/bundle.js:60471:24) at performConcurrentWorkOnRoot (http://localhost:3000/static/js/bundle.js:60383:26) ๐ฟ Hey developer ๐
You can provide a way better UX than this when your app throws errors by providing your own ErrorBoundary or errorElement prop on your route.