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

TypeError: Cannot use 'in' operator to search for 'colorSchemes' in null #44510

Open
Hammond2789 opened this issue Nov 22, 2024 · 0 comments
Open
Labels
package: system Specific to @mui/system status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@Hammond2789
Copy link

Hammond2789 commented Nov 22, 2024

Steps to reproduce

Steps:

import { createTheme, ThemeProvider, StyledEngineProvider } from '@mui/material/styles';
const thisTheme = createTheme({});
...
render() {
    return (
      <div className="App" style={{ height: "100%" }}>
        <StyledEngineProvider injectFirst>
          <ThemeProvider
            theme={thisTheme}
          >
            <SnackbarProvider
              domRoot={document.getElementById("notification-container")}
              iconVariant={{
                info: <NotificationsActive style={{ marginRight: 8 }} />,
              }}
            >
...
            </SnackbarProvider>
          </ThemeProvider>
        </StyledEngineProvider>
      </div>
    );
  }

Current behavior

When I try to open my web application I get the following error from within ThemeProvider line 20.

TypeError: Cannot use 'in' operator to search for 'colorSchemes' in null

Expected behavior

Not to get that error.

Context

I am attempting to upgrade to material v6 from v5. I believe I have followed the instructions from the upgrade webpage.

I have checked the documentation for Themes and I do not see any changes from v5 (please tell me if I am wrong).

Your environment

npx @mui/envinfo

System:
OS: Windows 10 10.0.19045
Binaries:
Node: 20.16.0 - C:\Program Files\nodejs\node.EXE
npm: 10.8.1 - C:\Program Files\nodejs\npm.CMD
pnpm: Not Found
Browsers:
Chrome: 131.0.6778.86
Edge: Chromium (128.0.2739.67)
npmPackages:
@emotion/react: ^11.13.5 => 11.13.5
@emotion/styled: ^11.13.5 => 11.13.5
@mui/base: ^5.0.0-beta.62 => 5.0.0-beta.62
@mui/core-downloads-tracker: 6.1.8
@mui/icons-material: ^6.0.0 => 6.1.8
@mui/lab: ^6.0.0-beta.16 => 6.0.0-beta.16
@mui/material: ^6.0.0 => 6.1.8
@mui/private-theming: 6.1.8
@mui/styled-engine: 6.1.8
@mui/system: 6.1.8
@mui/types: 7.2.19
@mui/utils: 6.1.8
@mui/x-date-pickers: ^7.22.2 => 7.22.3
@mui/x-internals: 7.21.0
@mui/x-tree-view: ^7.22.1 => 7.22.1
@types/react: 18.3.12
react: ^18.2.0 => 18.3.1
react-dom: ^18.2.0 => 18.3.1

Search keywords: colorSchemes

@Hammond2789 Hammond2789 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 22, 2024
@oliviertassinari oliviertassinari added the package: system Specific to @mui/system label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: system Specific to @mui/system status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants