Error message:
@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app.
The error above occurs in the following cases:
- You are do not have
MantineProviderin your app at all - You are rendering Mantine components outside of
MantineProvidercontext - You have different versions of
@mantine/*packages in your application. For example, you have@mantine/core@7.0.0and@mantine/dates@7.1.0installed. - There was an issue during packages installation. Usually this happens with pnpm.
- Your app has multiple instances of
@mantine/corepackage in the bundle. This may happen if your project is a monorepo and you have multiple node_modules folders.
Steps to resolve the issue:
- Make sure that you have
MantineProviderin your app and it wraps all Mantine components. - Make sure that you have only one version of
@mantine/corein your app. If you are using monorepo, make sure all packages depend on the same version of@mantine/core. - Reinstall dependencies by removing
node_modulesfolder and runningnpm installoryarn installagain. - If you still have issues, you can use one of the official templates as reference.