#In next 14 Got error: Element type is invalid: expected a string or a class/function but got obj

2 messages · Page 1 of 1 (latest)

solar nimbus
#

Currently i am working on a project which is build on next 14.2.1, and with mui ^5.15.13, currently all components in it are "use client", even

import { Box } from '@mui/material';

export default function Dashboard() {
  return (
    <>
      <h1>Hello</h1>
      <Box sx={{ backgroundColor: 'primary.main', padding: 16 }}>Hello</Box>
    </>
  );
}

was having "use client "(this is an eg), I wanted to make it server side by removing use client, but got "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object." after build,
I have searched for it a lot , but got nothing, even tried to import react at top, also tried import Box from '@mui/material/Box';. Please help me.

novel crystalBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)