Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address "Can't perform a React state update on an unmounted component" warnings in VxAdmin frontend tests #2970

Closed
arsalansufi opened this issue Feb 2, 2023 · 2 comments
Labels

Comments

@arsalansufi
Copy link
Contributor

arsalansufi commented Feb 2, 2023

These are happening in src/app_write_in_flows.test.tsx and src/app.test.tsx:

PASS  src/app.test.tsx (30.931 s)
  ● Console

    console.error
      Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
          at ReportsScreen (/home/circleci/project/frontends/election-manager/src/screens/reports_screen.tsx:37:26)

      at printWarning (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at warnAboutUpdateOnUnmountedFiberInDEV (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:23914:9)
      at scheduleUpdateOnFiber (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:21840:5)
      at dispatchAction (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:16139:5)
      at handleStoreChange (../../node_modules/.pnpm/use-sync-external-store@1.2.0_react@17.0.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js:188:9)
      at ../../node_modules/.pnpm/@tanstack+react-query@4.2.3_w7o5yyljkiidx2s2nzb26ottzu/node_modules/@tanstack/query-core/build/esm/index.js:717:9
      at notifyFn (../../node_modules/.pnpm/@tanstack+react-query@4.2.3_w7o5yyljkiidx2s2nzb26ottzu/node_modules/@tanstack/query-core/build/esm/index.js:676:5)

    console.error
      Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
          at TallyReportScreen (/home/circleci/project/frontends/election-manager/src/screens/tally_report_screen.tsx:43:49)

      at printWarning (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at warnAboutUpdateOnUnmountedFiberInDEV (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:23914:9)
      at scheduleUpdateOnFiber (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:21840:5)
      at dispatchAction (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:16139:5)
      at handleStoreChange (../../node_modules/.pnpm/use-sync-external-store@1.2.0_react@17.0.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js:188:9)
      at ../../node_modules/.pnpm/@tanstack+react-query@4.2.3_w7o5yyljkiidx2s2nzb26ottzu/node_modules/@tanstack/query-core/build/esm/index.js:717:9
      at notifyFn (../../node_modules/.pnpm/@tanstack+react-query@4.2.3_w7o5yyljkiidx2s2nzb26ottzu/node_modules/@tanstack/query-core/build/esm/index.js:676:5)

    console.error
      Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
          at TallyScreen (/home/circleci/project/frontends/election-manager/src/screens/tally_screen.tsx:41:7)

      at printWarning (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at warnAboutUpdateOnUnmountedFiberInDEV (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:23914:9)
      at scheduleUpdateOnFiber (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:21840:5)
      at dispatchAction (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:16139:5)
      at handleStoreChange (../../node_modules/.pnpm/use-sync-external-store@1.2.0_react@17.0.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js:188:9)
      at ../../node_modules/.pnpm/@tanstack+react-query@4.2.3_w7o5yyljkiidx2s2nzb26ottzu/node_modules/@tanstack/query-core/build/esm/index.js:717:9
      at notifyFn (../../node_modules/.pnpm/@tanstack+react-query@4.2.3_w7o5yyljkiidx2s2nzb26ottzu/node_modules/@tanstack/query-core/build/esm/index.js:676:5)

    console.error
      Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
          at LogicAndAccuracyScreen (/home/circleci/project/frontends/election-manager/src/screens/logic_and_accuracy_screen.tsx:13:34)

      at printWarning (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at warnAboutUpdateOnUnmountedFiberInDEV (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:23914:9)
      at scheduleUpdateOnFiber (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:21840:5)
      at dispatchAction (../../node_modules/.pnpm/react-dom@17.0.1_react@17.0.1/node_modules/react-dom/cjs/react-dom.development.js:16139:5)
      at handleStoreChange (../../node_modules/.pnpm/use-sync-external-store@1.2.0_react@17.0.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js:188:9)
      at ../../node_modules/.pnpm/@tanstack+react-query@4.2.3_w7o5yyljkiidx2s2nzb26ottzu/node_modules/@tanstack/query-core/build/esm/index.js:717:9
      at notifyFn (../../node_modules/.pnpm/@tanstack+react-query@4.2.3_w7o5yyljkiidx2s2nzb26ottzu/node_modules/@tanstack/query-core/build/esm/index.js:676:5)
@arsalansufi arsalansufi changed the title Address "Can't perform a React state update on an unmounted component." warnings in VxAdmin frontend tests Address "Can't perform a React state update on an unmounted component" warnings in VxAdmin frontend tests Feb 2, 2023
@arsalansufi arsalansufi added the bug label Feb 2, 2023
@adghayes
Copy link
Collaborator

adghayes commented Feb 2, 2023

Duplicate of #2798, which will be closed by #1660. In React 18 this is no longer a warning because it doesn't reflect a real problem.

@adghayes adghayes closed this as completed Feb 2, 2023
@arsalansufi
Copy link
Contributor Author

Ah nice, thanks for noting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants