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] Import error in Next.js #44590

Closed
ashishjaswal2002 opened this issue Nov 28, 2024 · 10 comments
Closed

[material-ui] Import error in Next.js #44590

ashishjaswal2002 opened this issue Nov 28, 2024 · 10 comments
Assignees
Labels

Comments

@ashishjaswal2002
Copy link

ashishjaswal2002 commented Nov 28, 2024

Steps to reproduce

Steps:

  1. Open this link to live example: (required)

Current behavior

Module not found: Can't resolve '@mui/material-nextjs/v15-appRouter'
1 |

2 | import { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@siriwatknp 

Expected behavior

No response

Context

Tech Stack NextJS

I am running this command in terminal

npm install @mui/material@latest @mui/icons-material@latest

`
import { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';

import localFont from "next/font/local";
import "./globals.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});

export const metadata = {
title: "one7sportsAdminPanel_Frontend",
description: "Admin panel frontend.",
};

export default function RootLayout({ children }) {
return (

<body
className={${geistSans.variable} ${geistMono.variable} antialiased}
>

{children}



);
}
`

Your environment

No response

Search keywords: Material ui

@ashishjaswal2002 ashishjaswal2002 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 28, 2024
@aarongarciah aarongarciah self-assigned this Nov 28, 2024
@aarongarciah
Copy link
Member

aarongarciah commented Nov 28, 2024

Hi @ashishjaswal2002, please provide a working playground or repository so we can take a look. The PR description is not helpful in its current state.

@aarongarciah aarongarciah added nextjs status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 28, 2024
@aarongarciah aarongarciah changed the title import Error Material Ui [material-ui] Import error in Next.js Nov 28, 2024
@aarongarciah
Copy link
Member

Looks like you need to install @mui/material-nextjs. Are you following this guide? https://mui.com/material-ui/integrations/nextjs/

@ashishjaswal2002
Copy link
Author

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Nov 28, 2024
@ashishjaswal2002
Copy link
Author

@aarongarciah yes i am following this guide.but i am getting an error of AppCache provider not found.

@ashishjaswal2002
Copy link
Author

Screenshot 2024-11-28 at 4 10 42 PM Screenshot 2024-11-28 at 5 51 59 PM

@aarongarciah
Copy link
Member

The first step on https://mui.com/material-ui/integrations/nextjs/#installing-the-dependencies is to install @mui/material-nextjs. Installing @mui/material-nextjs removes this error so I'll go ahead and close the issue.

@aarongarciah aarongarciah closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2024
@aarongarciah aarongarciah removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 28, 2024
@ashishjaswal2002
Copy link
Author

Wait

@ashishjaswal2002
Copy link
Author

ashishjaswal2002 commented Nov 28, 2024

Screenshot 2024-11-28 at 6 05 10 PM

NOT WORKING
I made a new commit you can check my repo the error still occurs @aarongarciah

@aarongarciah
Copy link
Member

Please, double check your code before opening or following up on issues. You have a typo in your latest commit: ashishjaswal2002/Materialuirepotesting@43a511a#diff-cd158e886cbb569ce897ddff3e4d29818b54947119242eefdf843f251696b7a3R2

@ashishjaswal2002
Copy link
Author

Yeah Working Fine Thankyou @aarongarciah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants