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

[material-ui][Tabs] Scrollable variant fails test when clicking the tab (error reading 'offsetHeight') #41388

Closed
Tracked by #42381
nicholeuf opened this issue Mar 7, 2024 · 18 comments · Fixed by #44593
Assignees
Labels
bug 🐛 Something doesn't work component: tabs This is the name of the generic UI component, not the React module! external dependency Blocked by external dependency, we can’t do anything about it package: material-ui Specific to @mui/material ready to take Help wanted. Guidance available. There is a high chance the change will be accepted

Comments

@nicholeuf
Copy link

nicholeuf commented Mar 7, 2024

Steps to reproduce

Update Jun 7, 2024: There was a comment on the PR questioning whether the original live example isn't depending on #36485. Therefore, a new live example was created and linked below, which is connected to https://github.com/nicholeuf/mui-test-fixture-41388.

Screenshot 2024-06-07 at 3 40 13 PM

Original link to live example: codesandbox.io

This only seems to happen under test. See the test scenario in the link above.

Current behavior

The test fails with the following error:

    TypeError: Cannot read properties of null (reading 'offsetHeight')

      at setMeasurements (node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@mui/material/node/Tabs/ScrollbarSize.js:40:47)

It fails at:

const setMeasurements = () => {
scrollbarHeight.current = nodeRef.current.offsetHeight - nodeRef.current.clientHeight;
};

Expected behavior

The test passes.

Context

I would like to test my application with a similar code setup.

Your environment

npx @mui/envinfo

From live example:

 System:
    OS: Linux 6.1 Ubuntu 20.04.6 LTS (Focal Fossa)
  Binaries:
    Node: 20.12.1 - /home/codespace/nvm/current/bin/node
    npm: 10.5.0 - /home/codespace/nvm/current/bin/npm
    pnpm: 8.15.6 - /home/codespace/nvm/current/bin/pnpm
  Browsers:
    Chrome: Not Found
  npmPackages:
    @emotion/react: ^11.11.4 => 11.11.4 
    @emotion/styled: ^11.11.5 => 11.11.5 
    @mui/material: ^5.15.19 => 5.15.19 
    @mui/material-nextjs: ^5.15.11 => 5.15.11 
    @types/react: ^18.3.3 => 18.3.3 
    react: ^18.3.1 => 18.3.1 
    react-dom: ^18.3.1 => 18.3.1 
    typescript: ^5.4.5 => 5.4.5 

From original project where error was discovered:

System:
    OS: macOS 14.3.1
  Binaries:
    Node: 18.19.1 - ~/.nvm/versions/node/v18.19.1/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v18.19.1/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 122.0.6261.111
    Edge: Not Found
    Safari: 17.3.1
  npmPackages:
    @emotion/react: ^11.11.4 => 11.11.4
    @emotion/styled: ^11.11.0 => 11.11.0
    @mui/base:  5.0.0-beta.38
    @mui/core-downloads-tracker:  5.15.12
    @mui/icons-material: ^5.15.12 => 5.15.12
    @mui/material: ^5.15.12 => 5.15.12
    @mui/material-nextjs: ^5.15.11 => 5.15.11
    @mui/private-theming:  5.15.12
    @mui/styled-engine:  5.15.11
    @mui/system:  5.15.12
    @mui/types:  7.2.13
    @mui/utils:  5.15.12
    @types/react: ^18.2.63 => 18.2.63
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    typescript: ^5.3.3 => 5.3.3

Search keywords: tabs scrollable test

@nicholeuf nicholeuf added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 7, 2024
@zannager zannager added the component: tabs This is the name of the generic UI component, not the React module! label Mar 7, 2024
@danilo-leal danilo-leal changed the title Tabs with scrollable variant fails test when clicking the tab (error reading 'offsetHeight') [material-ui][Tabs] Scrollable variant fails test when clicking the tab (error reading 'offsetHeight') Mar 7, 2024
@danilo-leal danilo-leal added the package: material-ui Specific to @mui/material label Mar 7, 2024
@joacub
Copy link

joacub commented Apr 2, 2024

Same here on Next.js with ppr activated (https://nextjs.org/docs/app/api-reference/next-config-js/partial-prerendering).

@ZeeshanTamboli
Copy link
Member

Looks like a bug.

@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 29, 2024
@supidupicoder2
Copy link

supidupicoder2 commented Apr 30, 2024

Same happens for me but without tests, just when trying to navigate to a specific view.

EDIT: What fixed it for me is using react and react-dom version 18.2.0 instead of 0.0.0-experimental-fb10a2c66-20240228

@joacub
Copy link

joacub commented May 9, 2024

will be this fixed? can not update anymore nextjs , this is a simple check if the reference is undefined .....

@thovden
Copy link

thovden commented May 17, 2024

This fails for me using the latest React 19 RC and React Compiler.

@eb-revel
Copy link

eb-revel commented May 20, 2024

Also started getting this issue when rendering Tabs with React 19 / React Compiler. Monkey-patching setMeasurements inside @mui/material/Tabs/ScrollbarSize.js to the version below helps unblock development, hope this gets patched as React Compiler is a game changer for our app's performance.

  const setMeasurements = () => {
    if (nodeRef.current && scrollbarHeight.current) {
      scrollbarHeight.current = nodeRef.current.offsetHeight - nodeRef.current.clientHeight;
    }
  };

In case anyone else is blocked by this try https://www.npmjs.com/package/patch-package until this gets fixed

@ZeeshanTamboli
Copy link
Member

Feel free to create a PR with a reproduction and a test.

@nicholeuf
Copy link
Author

nicholeuf commented Jun 3, 2024

Feel free to create a PR with a reproduction and a test.

@ZeeshanTamboli I created a PR #42512 and linked it to this issue

nicholeuf added a commit to nicholeuf/mui-test-fixture-41388 that referenced this issue Jun 7, 2024
Demonstrating that the latest mui version still has the issue described
in mui/material-ui#41388.

### Test Results
```
➜  mui-test-fixture-41388 git:(test-fixture-latest) ✗ pnpm run test

> [email protected] test /Users/nicholefrey/Workspace/mui-test-fixture-41388
> jest

  console.error
    Error: Uncaught [TypeError: Cannot read properties of null (reading 'offsetHeight')]
        at reportException (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
        at innerInvokeEventListeners (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:353:9)
        at invokeEventListeners (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
        at HTMLUnknownElementImpl._dispatch (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
        at HTMLUnknownElementImpl.dispatchEvent (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
        at HTMLUnknownElement.dispatchEvent (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
        at Object.invokeGuardedCallbackDev (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12687:16)
        at invokeGuardedCallback (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12748:31)
        at reportUncaughtErrorInDEV (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12775:5)
        at captureCommitPhaseError (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16366:5)
        at commitPassiveMountEffects_complete (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14423:9)
        at commitPassiveMountEffects_begin (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
        at commitPassiveMountEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
        at flushPassiveEffectsImpl (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
        at flushPassiveEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
        at workLoop (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
        at flushWork (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
        at performWorkUntilDeadline (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
        at Timeout.task [as _onTimeout] (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)
        at listOnTimeout (node:internal/timers:573:17)
        at processTimers (node:internal/timers:514:7) {
      detail: TypeError: Cannot read properties of null (reading 'offsetHeight')
          at setMeasurements (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/ScrollbarSize.js:40:47)
          at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/ScrollbarSize.js:58:5
          at commitHookEffectListMount (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13038:26)
          at commitPassiveMountOnFiber (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14461:11)
          at commitPassiveMountEffects_complete (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14421:9)
          at commitPassiveMountEffects_begin (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
          at commitPassiveMountEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
          at flushPassiveEffectsImpl (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
          at flushPassiveEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
          at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
          at workLoop (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
          at flushWork (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
          at performWorkUntilDeadline (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
          at Timeout.task [as _onTimeout] (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)
          at listOnTimeout (node:internal/timers:573:17)
          at processTimers (node:internal/timers:514:7),
      type: 'unhandled exception'
    }

      at VirtualConsole.<anonymous> (node_modules/.pnpm/[email protected]/node_modules/jest-environment-jsdom/build/index.js:63:23)
      at reportException (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:70:28)
      at innerInvokeEventListeners (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:353:9)
      at invokeEventListeners (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
      at HTMLUnknownElementImpl._dispatch (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
      at HTMLUnknownElementImpl.dispatchEvent (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
      at HTMLUnknownElement.dispatchEvent (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
      at Object.invokeGuardedCallbackDev (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12687:16)
      at invokeGuardedCallback (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12748:31)
      at reportUncaughtErrorInDEV (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12775:5)
      at captureCommitPhaseError (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16366:5)
      at commitPassiveMountEffects_complete (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14423:9)
      at commitPassiveMountEffects_begin (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
      at commitPassiveMountEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
      at flushPassiveEffectsImpl (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
      at flushPassiveEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
      at node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
      at workLoop (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
      at flushWork (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
      at performWorkUntilDeadline (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
      at Timeout.task [as _onTimeout] (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

  console.error
    Error: Uncaught [TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.]
        at reportException (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
        at innerInvokeEventListeners (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:353:9)
        at invokeEventListeners (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
        at HTMLUnknownElementImpl._dispatch (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
        at HTMLUnknownElementImpl.dispatchEvent (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
        at HTMLUnknownElement.dispatchEvent (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
        at Object.invokeGuardedCallbackDev (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12687:16)
        at invokeGuardedCallback (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12748:31)
        at reportUncaughtErrorInDEV (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12775:5)
        at captureCommitPhaseError (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16366:5)
        at commitPassiveMountEffects_complete (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14423:9)
        at commitPassiveMountEffects_begin (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
        at commitPassiveMountEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
        at flushPassiveEffectsImpl (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
        at flushPassiveEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
        at workLoop (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
        at flushWork (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
        at performWorkUntilDeadline (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
        at Timeout.task [as _onTimeout] (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)
        at listOnTimeout (node:internal/timers:573:17)
        at processTimers (node:internal/timers:514:7) {
      detail: TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
          at Object.exports.convert (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/generated/Node.js:25:9)
          at MutationObserver.observe (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/generated/MutationObserver.js:126:23)
          at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/Tabs.js:542:24
          at commitHookEffectListMount (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13038:26)
          at commitPassiveMountOnFiber (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14461:11)
          at commitPassiveMountEffects_complete (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14421:9)
          at commitPassiveMountEffects_begin (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
          at commitPassiveMountEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
          at flushPassiveEffectsImpl (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
          at flushPassiveEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
          at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
          at workLoop (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
          at flushWork (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
          at performWorkUntilDeadline (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
          at Timeout.task [as _onTimeout] (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)
          at listOnTimeout (node:internal/timers:573:17)
          at processTimers (node:internal/timers:514:7),
      type: 'unhandled exception'
    }

      at VirtualConsole.<anonymous> (node_modules/.pnpm/[email protected]/node_modules/jest-environment-jsdom/build/index.js:63:23)
      at reportException (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:70:28)
      at innerInvokeEventListeners (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:353:9)
      at invokeEventListeners (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
      at HTMLUnknownElementImpl._dispatch (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
      at HTMLUnknownElementImpl.dispatchEvent (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
      at HTMLUnknownElement.dispatchEvent (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
      at Object.invokeGuardedCallbackDev (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12687:16)
      at invokeGuardedCallback (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12748:31)
      at reportUncaughtErrorInDEV (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12775:5)
      at captureCommitPhaseError (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16366:5)
      at commitPassiveMountEffects_complete (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14423:9)
      at commitPassiveMountEffects_begin (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
      at commitPassiveMountEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
      at flushPassiveEffectsImpl (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
      at flushPassiveEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
      at node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
      at workLoop (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
      at flushWork (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
      at performWorkUntilDeadline (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
      at Timeout.task [as _onTimeout] (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

  console.error
    The above error occurred in the <ScrollbarSize> component:

        at ScrollbarSize (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/ScrollbarSize.js:34:7)
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at div
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Tabs (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/Tabs.js:215:44)
        at div
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Box (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/createBox.js:31:41)
        at div
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Box (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/createBox.js:31:41)
        at div
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Container (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/Container/createContainer.js:110:19)
        at DynamicScrollableTabs (/Users/nicholefrey/Workspace/mui-test-fixture-41388/app/components/DynamicScrollableTabs.tsx:11:35)
        at div
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Container (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/Container/createContainer.js:110:19)
        at main
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Box (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/createBox.js:31:41)
        at Home
        at RtlProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/RtlProvider/index.js:19:7)
        at ThemeProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected][email protected]/node_modules/@mui/private-theming/node/ThemeProvider/ThemeProvider.js:39:5)
        at ThemeProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/ThemeProvider/ThemeProvider.js:51:5)
        at ThemeProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/styles/ThemeProvider.js:21:14)
        at AppRouterCacheProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected]_@[email protected]_jirg5sb6fuv6a2okjalkv3ce7e/node_modules/@mui/material-nextjs/node/v13-appRouter/appRouterV13.js:24:5)
        at ThemeContainer (/Users/nicholefrey/Workspace/mui-test-fixture-41388/app/ThemeContainer.tsx:11:58)
        at TestWrapper (/Users/nicholefrey/Workspace/mui-test-fixture-41388/utils/test-utils.tsx:11:52)

    Consider adding an error boundary to your tree to customize error handling behavior.
    Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

      at logCapturedError (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:8678:23)
      at update.callback (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:8711:5)
      at callCallback (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5175:12)
      at commitUpdateQueue (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5196:9)
      at commitLayoutEffectOnFiber (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13271:13)
      at commitLayoutMountEffects_complete (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14369:9)
      at commitLayoutEffects_begin (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14355:7)
      at commitLayoutEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14340:3)
      at commitRootImpl (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16101:5)
      at commitRoot (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15972:5)
      at performSyncWorkOnRoot (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15493:3)
      at flushSyncCallbacks (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2597:22)
      at flushPassiveEffectsImpl (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16300:3)
      at flushPassiveEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
      at node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
      at workLoop (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
      at flushWork (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
      at performWorkUntilDeadline (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
      at Timeout.task [as _onTimeout] (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

  console.error
    The above error occurred in the <ForwardRef(Tabs)> component:

        at Tabs (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/Tabs.js:215:44)
        at div
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Box (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/createBox.js:31:41)
        at div
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Box (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/createBox.js:31:41)
        at div
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Container (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/Container/createContainer.js:110:19)
        at DynamicScrollableTabs (/Users/nicholefrey/Workspace/mui-test-fixture-41388/app/components/DynamicScrollableTabs.tsx:11:35)
        at div
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Container (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/Container/createContainer.js:110:19)
        at main
        at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@emotion[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-f93e57b0.cjs.dev.js:62:23
        at Box (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/createBox.js:31:41)
        at Home
        at RtlProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/RtlProvider/index.js:19:7)
        at ThemeProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected][email protected]/node_modules/@mui/private-theming/node/ThemeProvider/ThemeProvider.js:39:5)
        at ThemeProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+styled@_ayxiereyurbklw6aphsp47qvvu/node_modules/@mui/system/ThemeProvider/ThemeProvider.js:51:5)
        at ThemeProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/styles/ThemeProvider.js:21:14)
        at AppRouterCacheProvider (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected]_@[email protected]_jirg5sb6fuv6a2okjalkv3ce7e/node_modules/@mui/material-nextjs/node/v13-appRouter/appRouterV13.js:24:5)
        at ThemeContainer (/Users/nicholefrey/Workspace/mui-test-fixture-41388/app/ThemeContainer.tsx:11:58)
        at TestWrapper (/Users/nicholefrey/Workspace/mui-test-fixture-41388/utils/test-utils.tsx:11:52)

    Consider adding an error boundary to your tree to customize error handling behavior.
    Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

      at logCapturedError (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:8678:23)
      at update.callback (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:8711:5)
      at callCallback (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5175:12)
      at commitUpdateQueue (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5196:9)
      at commitLayoutEffectOnFiber (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13271:13)
      at commitLayoutMountEffects_complete (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14369:9)
      at commitLayoutEffects_begin (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14355:7)
      at commitLayoutEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14340:3)
      at commitRootImpl (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16101:5)
      at commitRoot (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15972:5)
      at performSyncWorkOnRoot (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15493:3)
      at flushSyncCallbacks (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2597:22)
      at flushPassiveEffectsImpl (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16300:3)
      at flushPassiveEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
      at node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
      at workLoop (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
      at flushWork (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
      at performWorkUntilDeadline (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
      at Timeout.task [as _onTimeout] (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

  console.error
    Error: Uncaught [TypeError: Cannot read properties of null (reading 'offsetHeight')]
        at reportException (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
        at Timeout.task [as _onTimeout] (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:525:9)
        at listOnTimeout (node:internal/timers:573:17)
        at processTimers (node:internal/timers:514:7) {
      detail: TypeError: Cannot read properties of null (reading 'offsetHeight')
          at setMeasurements (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/ScrollbarSize.js:40:47)
          at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/ScrollbarSize.js:58:5
          at commitHookEffectListMount (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13038:26)
          at commitPassiveMountOnFiber (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14461:11)
          at commitPassiveMountEffects_complete (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14421:9)
          at commitPassiveMountEffects_begin (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
          at commitPassiveMountEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
          at flushPassiveEffectsImpl (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
          at flushPassiveEffects (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
          at /Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
          at workLoop (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
          at flushWork (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
          at performWorkUntilDeadline (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
          at Timeout.task [as _onTimeout] (/Users/nicholefrey/Workspace/mui-test-fixture-41388/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)
          at listOnTimeout (node:internal/timers:573:17)
          at processTimers (node:internal/timers:514:7),
      type: 'unhandled exception'
    }

      at VirtualConsole.<anonymous> (node_modules/.pnpm/[email protected]/node_modules/jest-environment-jsdom/build/index.js:63:23)
      at reportException (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:70:28)
      at Timeout.task [as _onTimeout] (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:525:9)

 FAIL  app/page.test.tsx
  The Page
    ✓ has expected snapshot (64 ms)
    ✕ works as expected (558 ms)

  ● The Page › works as expected

    TypeError: Cannot read properties of null (reading 'offsetHeight')

      at setMeasurements (node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/ScrollbarSize.js:40:47)
      at node_modules/.pnpm/@mui[email protected]_@[email protected]_@[email protected][email protected]__@emotion+style_ddscnvx52uo2ovufgi3btuvqoe/node_modules/@mui/material/node/Tabs/ScrollbarSize.js:58:5
      at commitHookEffectListMount (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13038:26)
      at commitPassiveMountOnFiber (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14461:11)
      at commitPassiveMountEffects_complete (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14421:9)
      at commitPassiveMountEffects_begin (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
      at commitPassiveMountEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
      at flushPassiveEffectsImpl (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
      at flushPassiveEffects (node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
      at node_modules/.pnpm/[email protected][email protected]/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
      at workLoop (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:266:34)
      at flushWork (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:239:14)
      at performWorkUntilDeadline (node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.development.js:533:21)
      at Timeout.task [as _onTimeout] (node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

----------------------------|---------|----------|---------|---------|-------------------
File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------------------|---------|----------|---------|---------|-------------------
All files                   |    89.1 |    85.71 |      80 |    89.1 |
 app                        |      80 |    66.66 |   66.66 |      80 |
  ThemeContainer.tsx        |     100 |      100 |     100 |     100 |
  layout.tsx                |       0 |        0 |       0 |       0 | 1-17
  page.tsx                  |     100 |      100 |     100 |     100 |
  theme.tsx                 |     100 |      100 |     100 |     100 |
 app/components             |     100 |      100 |     100 |     100 |
  DynamicScrollableTabs.tsx |     100 |      100 |     100 |     100 |
----------------------------|---------|----------|---------|---------|-------------------
Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 passed, 2 total
Snapshots:   1 passed, 1 total
Time:        3.032 s
Ran all test suites.
 ELIFECYCLE  Test failed. See above for more details.
```
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 23, 2024

This only seems to happen under test. See the test scenario in the link above.

From the reproduction https://github.com/nicholeuf/mui-test-fixture-41388, it seems to me that it's only that the snapshot test env isn't setup correctly. Doing this change fixes the issue:

diff --git a/utils/test-utils.tsx b/utils/test-utils.tsx
index f27a491..51c302a 100644
--- a/utils/test-utils.tsx
+++ b/utils/test-utils.tsx
@@ -17,8 +17,18 @@ const customRender = (
   options?: Omit<RenderOptions, 'wrapper'>
 ) => render(ui, { wrapper: TestWrapper, ...options });

-const customSnapshotRender = (children: ReactElement) =>
-  renderer.create(<TestWrapper>{children}</TestWrapper>);
+
+const customSnapshotRender = (children: ReactElement) => {
+  let root;
+  renderer.act(() => {
+    root = renderer.create(<TestWrapper>{children}</TestWrapper>, {
+      createNodeMock: (node) => {
+        return document.createElement(node.type as keyof HTMLElementTagNameMap);
+      },
+    });
+  });
+  return root;
+}

 export * from '@testing-library/react';
 export { customRender as render, customSnapshotRender as renderSnapshot };

See https://github.com/mui/material-ui/pull/16523/files#diff-d0f975a526b07952a6902336247e87b2de9a2d1ecd6c411c7492ac06009c8c73 for historical context.

@oliviertassinari oliviertassinari removed the bug 🐛 Something doesn't work label Jun 23, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 23, 2024

This fails for me using the latest React 19 RC

A reproduction of the issue: https://github.com/oliviertassinari/material-ui-issue-41388 issue with React 19.0.0-rc.0 and Next.js v15.0.0-rc.0.

SCR-20240624-bfpp

Looking closer, it's an issue with the ref. I have linked to #42381. #42512 is definitely the wrong fix.

Here is what happens:

To fix this, we can:

  1. In Material UI's <ScrollbarSize> internal component:
-return <div style={styles} ref={nodeRef} {...other} />;
+return <div style={styles} {...other} ref={nodeRef} />;

but this feels like a hack

  1. In Emotion, which would make more sense to me, in https://github.com/emotion-js/emotion/blob/4cc565f1b7a576902b6360654afa4ce176698f76/packages/styled/src/base.js#L160, only forward a ref, if one is defined.
+     if (ref) {
        newProps.ref = ref;
+     }

cc @Andarist

@oliviertassinari
Copy link
Member

Issue created emotion-js/emotion#3204.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work external dependency Blocked by external dependency, we can’t do anything about it React 19 support PRs required to support React 19 and removed test labels Jul 2, 2024
@oliviertassinari oliviertassinari added the ready to take Help wanted. Guidance available. There is a high chance the change will be accepted label Jul 9, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 9, 2024

Ok, the issue was solved in Emotion (not released yet): emotion-js/emotion#3204

But styled-components has the same problem 🙈: styled-components/styled-components#4331 (which we need to support for the sc engine adapter)

I think we can make the change in Material UI too, and call it a day. It will take some time for the developers to get the fix from Emotion, I'm not even sure Styled-components is maintained anymore, anyway.

-return <div style={styles} ref={nodeRef} {...other} />;
+return <div style={styles} {...other} ref={nodeRef} />;

To be noted that it only impacts this component because it doesn't use React.forwardRef.

@hoangqwe159
Copy link

Any update on this, please?

@DanFlannel
Copy link

DanFlannel commented Aug 14, 2024

@oliviertassinari looks like emotion fixed this in version 11.12.0 just as a head up! Thank you for making the fix.

@jmcpeak
Copy link
Contributor

jmcpeak commented Oct 22, 2024

Nest.js 15 has officially been released as of today but this is still broken with 6.1.5 - any update?

@AlbinoGeek
Copy link

AlbinoGeek commented Oct 30, 2024

This appears to be broken in NextJS 15 even if you choose the "stay on React 18" option.
[Unsure on if this is the right thread for this, but just noting for those following along.]

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@nicholeuf How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@DiegoAndai
Copy link
Member

DiegoAndai commented Nov 28, 2024

The fix has been merged and should be available in the next release (>v6.1.9)

I'll also backport it to v5: #44595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: tabs This is the name of the generic UI component, not the React module! external dependency Blocked by external dependency, we can’t do anything about it package: material-ui Specific to @mui/material ready to take Help wanted. Guidance available. There is a high chance the change will be accepted
Projects
None yet