-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Issue with the 'use client' directive when using Material UI auto complete #42840
Comments
Having the same issue with Checkbox as well. PFA the diff: var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); |
@ysumeet97 @sumeet-yedula I couldn't repro this using the latest versions of Next.js ( Here's a working demo: https://stackblitz.com/edit/stackblitz-starters-ptzusb?file=app%2Fpage.tsx |
Sure will try that and let you know |
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information. |
@ysumeet97 Are you using this library by any chance? https://github.com/kwonoj/swc-plugin-coverage-instrument experimental: {
swcPlugins: [
['swc-plugin-coverage-instrument', {}]
]
}, The issue is present across 1000+ @mui files including the following in my own project: I'm not sure whether it can be fixed from the instrumentation library side. |
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
@mui/system@5.15.20
for the project I'm working on.Facing an issue with the 'use client' directive when using Next.js v14.2.4 approuter and @mui/material v5.15.21
Note: This only happens when using any mui component that inherently uses /node_modules/@mui/material/Popper/Popper.js. In my case it was with an Autocomplete and Popover.
Please find the stacktrace below for an Autocomplete (Popover also has the similar stacktrace):
⨯ ./node_modules/@mui/system/useThemeWithoutDefault.js
Error:
× The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.
╭─[.../node_modules/@mui/system/useThemeWithoutDefault.js:1:1]
1 │ "use strict";
2 │ 'use client';
· ─────────────
3 │
4 │ Object.defineProperty(exports, "__esModule", {
5 │ value: true
╰────
Import trace for requested module:
./node_modules/@mui/system/useThemeWithoutDefault.js
./node_modules/@mui/material/Popper/Popper.js
./node_modules/@mui/material/Popper/index.js
./node_modules/@mui/material/Autocomplete/Autocomplete.js
./node_modules/@mui/material/Autocomplete/index.js
barrel_optimize?names=Autocomplete,Box,TextField,styled!=!./node_modules/@mui/material/index.js
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
Search keywords:
The text was updated successfully, but these errors were encountered: