Skip to content

Conversation

@devchenyan
Copy link
Contributor

@devchenyan devchenyan commented Mar 12, 2025

issue:

[2025-03-12T05:22:49.106Z] [error] [
  "UI crash: Cannot destructure property 'status' of 'item' as it is null.",
  {
    stack: "TypeError: Cannot destructure property 'status' of 'item' as it is null.\n" +
      '    at TransactionType (http://localhost:3000/src/components/TransactionType/index.tsx:62:9)\n' +
      '    at renderWithHooks (http://localhost:3000/node_modules/.vite/deps/chunk-XKMW3FHY.js?v=249d37e2:19079:26)\n' +
      '    at mountIndeterminateComponent (http://localhost:3000/node_modules/.vite/deps/chunk-XKMW3FHY.js?v=249d37e2:21829:21)\n' +
      '    at beginWork (http://localhost:3000/node_modules/.vite/deps/chunk-XKMW3FHY.js?v=249d37e2:22810:22)\n' +
      '    at beginWork$1 (http://localhost:3000/node_modules/.vite/deps/chunk-XKMW3FHY.js?v=249d37e2:26654:22)\n' +
      '    at performUnitOfWork (http://localhost:3000/node_modules/.vite/deps/chunk-XKMW3FHY.js?v=249d37e2:26099:20)\n' +
      '    at workLoopSync (http://localhost:3000/node_modules/.vite/deps/chunk-XKMW3FHY.js?v=249d37e2:26038:13)\n' +
      '    at renderRootSync (http://localhost:3000/node_modules/.vite/deps/chunk-XKMW3FHY.js?v=249d37e2:26017:15)\n' +
      '    at recoverFromConcurrentError (http://localhost:3000/node_modules/.vite/deps/chunk-XKMW3FHY.js?v=249d37e2:25634:28)\n' +
      '    at performConcurrentWorkOnRoot (http://localhost:3000/node_modules/.vite/deps/chunk-XKMW3FHY.js?v=249d37e2:25582:30)',
    componentStack: '\n' +
      '    at TransactionType (http://localhost:3000/src/components/TransactionType/index.tsx:54:3)\n' +
      '    at td\n' +
      '    at tr\n' +
      '    at tbody\n' +
      '    at table\n' +
      '    at div\n' +
      '    at Table (http://localhost:3000/src/widgets/Table/index.tsx:39:5)\n' +
      '    at div\n' +
      '    at div\n' +
      '    at div\n' +
      '    at PageContainer (http://localhost:3000/src/components/PageContainer/index.tsx:72:7)\n' +
      '    at History (http://localhost:3000/src/components/History/index.tsx?t=1741756769124:60:7)\n' +
      '    at RenderedRoute (http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=249d37e2:3537:5)\n' +
      '    at RenderedRoute (http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=249d37e2:3537:5)\n' +
      '    at Outlet (http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=249d37e2:3907:26)\n' +
      '    at div\n' +
      '    at MainContent (http://localhost:3000/src/containers/Main/index.tsx:46:20)\n' +
      '    at LockWindow (http://localhost:3000/src/containers/LockWindow/index.tsx:55:23)\n' +
      '    at RenderedRoute (http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=249d37e2:3537:5)\n' +
      '    at RouterRender (http://localhost:3000/src/index.tsx?t=1741756961145:40:10)\n' +
      '    at Router (http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=249d37e2:3914:15)\n' +
      '    at HashRouter (http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=249d37e2:4677:5)\n' +
      '    at Suspense\n' +
      '    at ErrorBoundary (http://localhost:3000/src/components/ErrorBoundary/index.tsx?t=1741756961145:35:5)\n' +
      '    at ComponentWithNeuronWallet\n' +
      '    at http://localhost:3000/src/states/stateProvider/provider.tsx:38:35'
  }
]

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces enhanced logging for UI crashes by updating error handling in the ErrorBoundary component and adding new error logging in the wallet API controller.

  • The ErrorBoundary is updated to include component stack information and improved error messages.
  • A new call to log errors using logger.error is added in the API controller to aid in debugging.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/neuron-ui/src/components/ErrorBoundary/index.tsx Enhanced error handling and logging with additional error info and a conditional page reload
packages/neuron-wallet/src/controllers/api.ts Added error logging using logger.error for improved diagnostics

@Keith-CY Keith-CY added this pull request to the merge queue Mar 13, 2025
Merged via the queue into nervosnetwork:develop with commit fc96a32 Mar 13, 2025
10 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Mar 13, 2025
* feat: Add UI crash logs

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants