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

Bug: Error in useEffect is caught in ErrorBoundary, but still logs uncaught error to console in tests #18841

Closed
mpeyper opened this issue May 6, 2020 · 17 comments
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@mpeyper
Copy link

mpeyper commented May 6, 2020

React version: 16.13.1

Steps To Reproduce

  1. Create a component with a useEffect hook
  2. Render the component in an error boundary using react-test-renderer
  3. Throw an error synchronously in the effect callback (i.e. not in a promise callback)
  4. Observe the error in the console

Link to code example: https://github.com/mpeyper/error-boundary-error-repro

The current behavior

When you first clone the repo, all the tests are being skipped. This is to reduce the noise when observing the output. Please remove the .skip from the tests to see the output.

Note that I have also used react-error-boundary for creating the error boundaries in the example repo to simplify the setup, but if you believe this is interfering with test, I'm happy to hand roll an error boundary instead.

Given the following two components, the way in which the error is being handled is inconsistent when using react-test-renderer vs. react-dom (via @testing-library/react in my example):

export function HasErrorInRender() {
  throw Error("This error was expected")
}

export function HasErrorInEffect() {
  useEffect(() => {
    throw Error("This error was expected")
  })

  return <p>This component has an error in an effect</p>
}

When rendering with react-dom, both the following tests pass, and produce the same output in the console:

describe('@testing-library/react', () => {
  test('should catch error in render', () => {
    let err = null
    function Fallback({ error }) {
      err = error
      return <p>An error was thrown</p>
    }

    render((
      <ErrorBoundary FallbackComponent={Fallback}>
        <HasErrorInRender />
      </ErrorBoundary>
    ))

    expect(err).toEqual(Error("This error was expected"))
  })

  test('should catch error in effect', () => {
    let err = null
    function Fallback({ error }) {
      err = error
      return <p>An error was thrown</p>
    }

    render((
      <ErrorBoundary FallbackComponent={Fallback}>
        <HasErrorInEffect />
      </ErrorBoundary>
    ))

    expect(err).toEqual(Error("This error was expected"))
  })
})

The output they produce is:

  console.error node_modules/jsdom/lib/jsdom/virtual-console.js:29
    Error: Uncaught [Error: This error was expected]
        at reportException (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
        at invokeEventListeners (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:209:9)
        at HTMLUnknownElementImpl._dispatch (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:119:9)
        at HTMLUnknownElementImpl.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:82:17)
        at HTMLUnknownElementImpl.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js:30:27)
        at HTMLUnknownElement.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:157:21)
        at Object.invokeGuardedCallbackDev (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:237:16)
        at invokeGuardedCallback (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:292:31)
        at beginWork$1 (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:23203:7)
        at performUnitOfWork (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:22157:12) Error: This error was expected
        at HasErrorInRender (/<REDACTED>/error-boundary-error-repro/src/HasError.js:4:9)
        at renderWithHooks (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:14803:18)
        at mountIndeterminateComponent (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:17482:13)
        at beginWork (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:18596:16)
        at HTMLUnknownElement.callCallback (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:188:14)
        at invokeEventListeners (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:193:27)
        at HTMLUnknownElementImpl._dispatch (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:119:9)
        at HTMLUnknownElementImpl.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:82:17)
        at HTMLUnknownElementImpl.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js:30:27)
        at HTMLUnknownElement.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:157:21)
        at Object.invokeGuardedCallbackDev (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:237:16)
        at invokeGuardedCallback (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:292:31)
        at beginWork$1 (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:23203:7)
        at performUnitOfWork (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:22157:12)
        at workLoopSync (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:22130:22)
        at performSyncWorkOnRoot (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:21756:9)
        at scheduleUpdateOnFiber (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:21188:7)
        at updateContainer (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:24373:3)
        at /<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:24758:7
        at unbatchedUpdates (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:21903:12)
        at legacyRenderSubtreeIntoContainer (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:24757:5)
        at Object.render (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:24840:10)
        at /<REDACTED>/error-boundary-error-repro/node_modules/@testing-library/react/dist/pure.js:86:25
        at batchedUpdates$1 (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom.development.js:21856:12)
        at act (/<REDACTED>/error-boundary-error-repro/node_modules/react-dom/cjs/react-dom-test-utils.development.js:929:14)
        at render (/<REDACTED>/error-boundary-error-repro/node_modules/@testing-library/react/dist/pure.js:82:26)
        at Object.<anonymous> (/<REDACTED>/error-boundary-error-repro/src/HasError.test.js:15:5)
        at Object.asyncJestTest (/<REDACTED>/error-boundary-error-repro/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:102:37)
        at /<REDACTED>/error-boundary-error-repro/node_modules/jest-jasmine2/build/queueRunner.js:43:12
        at new Promise (<anonymous>)
        at mapper (/<REDACTED>/error-boundary-error-repro/node_modules/jest-jasmine2/build/queueRunner.js:26:19)
        at /<REDACTED>/error-boundary-error-repro/node_modules/jest-jasmine2/build/queueRunner.js:73:41
        at processTicksAndRejections (internal/process/task_queues.js:97:5)

  console.error node_modules/react-dom/cjs/react-dom.development.js:19527
    The above error occurred in the <HasErrorInRender> component:
        in HasErrorInRender (at HasError.test.js:17)
        in ErrorBoundary (at HasError.test.js:16)
    
    React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.

This is somewhat expected when using react-dom and reflects the output one would see in the browser console if the some components were rendered in an app (you can run npm start in the example repo if you would like to observe this).

However, where things start to get a bit strange is when the renderer is replaced with react-test-renderer and the same tests are run:

describe('react-test-renderer', () => {
  test('should catch error in render', () => {
    let err = null
    function Fallback({ error }) {
      err = error
      return <p>An error was thrown</p>
    }

    act(() => {
      create((
        <ErrorBoundary FallbackComponent={Fallback}>
          <HasErrorInRender />
        </ErrorBoundary>
      ))
    })

    expect(err).toEqual(Error("This error was expected"))
  })

  test('should catch error in effect', () => {
    let err = null
    function Fallback({ error }) {
      err = error
      return <p>An error was thrown</p>
    }

    act(() => {
      create((
        <ErrorBoundary FallbackComponent={Fallback}>
          <HasErrorInEffect />
        </ErrorBoundary>
      ))
    })

    expect(err).toEqual(Error("This error was expected"))
  })
})

Again both tests here do pass, but the output they produce is not the same. When the first test (error in the render function) is run, it only produces the following output:

  console.error node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10141
    The above error occurred in the <HasErrorInRender> component:
        in HasErrorInRender (at HasError.test.js:52)
        in ErrorBoundary (at HasError.test.js:51)
    
    React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.

As you can see, the frustratingly difficult to suppress error log from the error boundary is present, but the long stack trace from the uncaught error that is present in the react-dom output is not.

When the second test (error in the useEffect callback) is run, the output is:

  console.error node_modules/jsdom/lib/jsdom/virtual-console.js:29
    Error: Uncaught [Error: This error was expected]
        at reportException (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
        at invokeEventListeners (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:209:9)
        at HTMLUnknownElementImpl._dispatch (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:119:9)
        at HTMLUnknownElementImpl.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:82:17)
        at HTMLUnknownElementImpl.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js:30:27)
        at HTMLUnknownElement.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:157:21)
        at Object.invokeGuardedCallbackDev (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10021:16)
        at invokeGuardedCallback (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10073:31)
        at flushPassiveEffectsImpl (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13345:9)
        at unstable_runWithPriority (/<REDACTED>/error-boundary-error-repro/node_modules/scheduler/cjs/scheduler.development.js:653:12) Error: This error was expected
        at /<REDACTED>/error-boundary-error-repro/src/HasError.js:9:11
        at commitHookEffectListMount (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10345:26)
        at commitPassiveHookEffects (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10383:11)
        at HTMLUnknownElement.callCallback (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9972:14)
        at invokeEventListeners (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:193:27)
        at HTMLUnknownElementImpl._dispatch (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:119:9)
        at HTMLUnknownElementImpl.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:82:17)
        at HTMLUnknownElementImpl.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js:30:27)
        at HTMLUnknownElement.dispatchEvent (/<REDACTED>/error-boundary-error-repro/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:157:21)
        at Object.invokeGuardedCallbackDev (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10021:16)
        at invokeGuardedCallback (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10073:31)
        at flushPassiveEffectsImpl (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13345:9)
        at unstable_runWithPriority (/<REDACTED>/error-boundary-error-repro/node_modules/scheduler/cjs/scheduler.development.js:653:12)
        at runWithPriority (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:1775:10)
        at flushPassiveEffects (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13312:12)
        at Object.<anonymous>.flushWork (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14883:10)
        at act (/<REDACTED>/error-boundary-error-repro/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15001:9)
        at Object.<anonymous> (/<REDACTED>/error-boundary-error-repro/src/HasError.test.js:67:5)
        at Object.asyncJestTest (/<REDACTED>/error-boundary-error-repro/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:102:37)
        at /<REDACTED>/error-boundary-error-repro/node_modules/jest-jasmine2/build/queueRunner.js:43:12
        at new Promise (<anonymous>)
        at mapper (/<REDACTED>/error-boundary-error-repro/node_modules/jest-jasmine2/build/queueRunner.js:26:19)
        at /<REDACTED>/error-boundary-error-repro/node_modules/jest-jasmine2/build/queueRunner.js:73:41
        at processTicksAndRejections (internal/process/task_queues.js:97:5)

  console.error node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10141
    The above error occurred in the <HasErrorInEffect> component:
        in HasErrorInEffect (at HasError.test.js:70)
        in ErrorBoundary (at HasError.test.js:69)
    
    React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.

Now, the uncaught error message is back, which is not what I would have expected. Even more confusingly, when inspecting the stacktrace of the uncaught error, it has references to jsdom which I was of the belief was not a dependency of react-test-renderer. I suspect that there is some jest and/or jsdom trickery going on to report the uncaught error, rather than react-test-renderer using it in some way, but I'm not familiar enough with any of them to know for certain.

The part that's has me the most perplexed is how the error boundary can intercept the error to pass into it's handler callbacks (surfaced in my example in react-error-boundary's FallbackComponent) without catching the error, unless it is throwing it again after catching it, but then both tests would be producing the uncaught error output, right?

The expected behavior

My expected (and preferred) behaviour here would be for the the react-test-renderer test to only produce the error boundary error log and not have any additional uncaught error output.

@mpeyper mpeyper added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label May 6, 2020
@mpeyper
Copy link
Author

mpeyper commented Jun 2, 2020

Is there some way to get some eyes on this? I don't want to be that Dev that tags a bunch of people, but this is the second issue I've raised here that has gone unnoticed (or at least unacknowledged) which is frustrating because I've tried my best to give a detailed and thorough report when raising it.

@davidcheal
Copy link

Not sure if this is the same issue, but using useEffect in a function with try/catch will also produce this. The catch will record the error, then throw an Uncaught Error: anyway.

Here is an example

const View = (props) => {
  try {
    const { msSagaState, msSettings, msUsers } = props
    useEffect(() => {
      try{
        console.log(ImNotDefined)
      }catch(error){
        throw errcode(new Error('useEffect failed'), 503, {detail: error.message})
      }
    }, [])
    return (
      <div className="users-view users-detail">
      </div>
    )
  } catch (error) {
    return <CompErrorCatch error={error} source="UserDetail" />
  }
}

results in;

Uncaught Error: useEffect failed
    at eval (view.js?10c1:24)
    at commitHookEffectList (react-dom.development.js?61bb:22030)
    at commitPassiveHookEffects (react-dom.development.js?61bb:22064)
    at HTMLUnknownElement.callCallback (react-dom.development.js?61bb:336)

it prevents the <CompErrorCatch /> from returning.

take out the useEffect and the catch returns as expected

@mpeyper
Copy link
Author

mpeyper commented Jun 5, 2020

@davidcheal yep, same issue

Edit: sorry, I got confused about which repo/issue I was looking at. It might be the same issue, but I'm not any kind of authority to say that.

@stale
Copy link

stale bot commented Sep 5, 2020

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Sep 5, 2020
@mpeyper
Copy link
Author

mpeyper commented Sep 6, 2020

Bump

@stale stale bot removed the Resolution: Stale Automatically closed due to inactivity label Sep 6, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Dec 25, 2020
@mpeyper
Copy link
Author

mpeyper commented Jan 2, 2021

Bump 😞

@prometheas
Copy link

Bump, please.

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 9, 2022
@okapies
Copy link

okapies commented Mar 1, 2022

Bump

@stale stale bot removed the Resolution: Stale Automatically closed due to inactivity label Mar 1, 2022
@arodriguezcortes
Copy link

I'm having the same issue. I implemented a top-level ErrorBoundary component just as described in the docs, and when I throw an error during rendering, the component that the ErrorBoundary should render is actually rendered, but for some reason the error is still logged as an Uncaught Error. Not sure if this is the desired behavior.

Screen Shot 2022-06-07 at 12 37 55 PM

@colinmegill
Copy link

Bump

@SagnikPradhan
Copy link

SagnikPradhan commented Aug 1, 2022

In case it is helpful, more error stack traces and code
  it("Should throw and catch error", async () => {
    render(
      <ReallyAnErrorBoundary fallback={({ error }) => <h1>{error.message}</h1>}>
        <Component error="Hello, I want to error" />
      </ReallyAnErrorBoundary>
    );

    await screen.findByText("Loading");
    await screen.findByText("Hello, I want to error");
  });
export interface ReallyAnErrorBoundaryProps {
  fallback: (options: { error: Error }) => ReactElement;
  children: ReactNode;
}

interface ReallyAnErrorBoundaryState {
  error: Error | null;
}

export class ReallyAnErrorBoundary extends Component<
  ReallyAnErrorBoundaryProps,
  ReallyAnErrorBoundaryState
> {
  constructor(props: ReallyAnErrorBoundaryProps) {
    super(props);
    this.state = { error: null };
  }

  static getDerivedStateFromError(error: Error) {
    return { error };
  }

  render() {
    const E = this.props.fallback;
    if (this.state.error) return <E error={this.state.error} />;
    else return this.props.children;
  }
}
  console.error
    Error: Uncaught [Error: Hello, I want to error]
        at reportException (D:\Projects\really-async\node_modules\.pnpm\jsdom@19.0.0\node_modules\jsdom\lib\jsdom\living\helpers\runtime-script-errors.js:66:24)
        at innerInvokeEventListeners (D:\Projects\really-async\node_modules\.pnpm\jsdom@19.0.0\node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:343:9)
        at invokeEventListeners (D:\Projects\really-async\node_modules\.pnpm\jsdom@19.0.0\node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:276:3)
        at HTMLUnknownElementImpl._dispatch (D:\Projects\really-async\node_modules\.pnpm\jsdom@19.0.0\node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:223:9)
        at HTMLUnknownElementImpl.dispatchEvent (D:\Projects\really-async\node_modules\.pnpm\jsdom@19.0.0\node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:94:17)
        at HTMLUnknownElement.dispatchEvent (D:\Projects\really-async\node_modules\.pnpm\jsdom@19.0.0\node_modules\jsdom\lib\jsdom\living\generated\EventTarget.js:241:34)
        at Object.invokeGuardedCallbackDev (D:\Projects\really-async\node_modules\.pnpm\react-dom@18.2.0_react@18.2.0\node_modules\react-dom\cjs\react-dom.development.js:4213:16)
        at invokeGuardedCallback (D:\Projects\really-async\node_modules\.pnpm\react-dom@18.2.0_react@18.2.0\node_modules\react-dom\cjs\react-dom.development.js:4277:31)
        at reportUncaughtErrorInDEV (D:\Projects\really-async\node_modules\.pnpm\react-dom@18.2.0_react@18.2.0\node_modules\react-dom\cjs\react-dom.development.js:22838:5)
        at captureCommitPhaseError (D:\Projects\really-async\node_modules\.pnpm\react-dom@18.2.0_react@18.2.0\node_modules\react-dom\cjs\react-dom.development.js:27126:5) {
      detail: Error: Hello, I want to error
          at GeneratorComponent (D:\Projects\really-async\source\index.test.tsx:18:22),
      type: 'unhandled exception'
    }

      at VirtualConsole.<anonymous> (node_modules/.pnpm/jest-environment-jsdom@28.1.3/node_modules/jest-environment-jsdom/build/index.js:70:23)
      at reportException (node_modules/.pnpm/jsdom@19.0.0/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:70:28)
      at innerInvokeEventListeners (node_modules/.pnpm/jsdom@19.0.0/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:343:9)
      at invokeEventListeners (node_modules/.pnpm/jsdom@19.0.0/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:276:3)
      at HTMLUnknownElementImpl._dispatch (node_modules/.pnpm/jsdom@19.0.0/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:223:9)
      at HTMLUnknownElementImpl.dispatchEvent (node_modules/.pnpm/jsdom@19.0.0/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:94:17)

  console.error
    The above error occurred in one of your React components:

        at useAsyncGenerator (D:\Projects\really-async\source\index.tsx:47:31)
        at div
        at ReallyAnErrorBoundary (D:\Projects\really-async\source\index.tsx:71:5)

    React will try to recreate this component tree from scratch using the error boundary you provided, ReallyAnErrorBoundary.

      at logCapturedError (node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.development.js:18687:23)
      at ReallyAnErrorBoundary.update.callback (node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.development.js:18743:7)
      at callCallback (node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.development.js:13923:12)
      at commitUpdateQueue (node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.development.js:13944:9)
      at commitLayoutEffectOnFiber (node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.development.js:23364:13)
      at commitLayoutMountEffects_complete (node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.development.js:24688:9)
      at commitLayoutEffects_begin (node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom.development.js:24674:7)

Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Apr 10, 2024
@SagnikPradhan
Copy link

Bump. Still is a thing on 18.2.0

@github-actions github-actions bot removed the Resolution: Stale Automatically closed due to inactivity label Apr 17, 2024
Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Jul 16, 2024
Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

7 participants