Skip to content

[nextjs] Cannot use sx prop on layout components #193

@siriwatknp

Description

@siriwatknp

Steps to reproduce

Renders the Stack with sx prop:

import Stack from "@mui/material-pigment-css/Stack";

<Stack sx={{}} />

Current behavior

Got this error:

image

Without using sx prop, it works fine.

Also, vite has no issue, so I think this is nextjs-plugin specific

Expected behavior

Should not throw errors

Context

Found this issue from mui/material-ui#43065 (review)

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: sx error

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions