I'm currently facing an issue with my Next.js application where the routing isn't behaving as expected. I'm well aware that Next.js uses a file-system based router, where the pages directory structure directly correlates to the application's routes. Folders within pages are used to define nested routes, and files like index.tsx are meant to represent the root of a given path.
My problem is that my index.tsx inside the pages directory isn't being recognized as the root route (/). Instead, when I run my project, it's compiling a different page, or showing a /not-found error in the browser, as if the index.tsx page doesn't exist. Here's what my structure looks like
project-root/
├── pages/
│ ├── index.tsx
│ └── privacy-policy.tsx
├── app/
│ ├── (other non-page components)
├── public/
├── styles/
└── (other config files)
Additionally, I have a custom RootLayout component that utilizes MantineProvider from @mantine/core to inject global styles and themes. I've ensured that this provider wraps my component tree, but I'm still getting an error stating that MantineProvider was not found in the component tree.
Could someone please help me troubleshoot this issue? I'm looking for insights into why my index.tsx isn't serving as the homepage and why MantineProvider isn't being recognized despite being included in my component hierarchy.
Thanks in advance for any help you can provide!