-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
False error: MantineProvider was not found in component tree, make sure you have it in your app (reopening with reproduction) #5811
Comments
thats a pretty massive repro case. i don't have the patience to look through all that boilerplate code but generally that error means that you're attempting to render a mantine component somewhere that isn't within the first thing i'd try if i were you would be to wrap your entire App and ErrorBoundary in it. https://github.com/simonszalai/mantine_repro/blob/main/app/root.tsx#L169C10-L172 |
I know what the error says and obviously thats the first thing I checked, and the provider is there. The reason I sent a repro so massive because I could not reproduce it in a fresh project, there it worked. Eventually I just started over and moved my code to a new project and got it working, but there is something in here that triggers that error incorrectly. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
One idea is to replace all instances of useMantineTheme() in the code with useMantineSafeTheme(). This would resolve the issue, but it would require users of a monorepo to individually apply styles to components, which could be considered a disadvantage. but that could be done via overriding css variables?. @rtivital and the others what do you think? https://mantine.dev/styles/css-variables/ Code here: Line 8 in 4c9a875
|
It is a bad idea that will lead to more frustration. |
I also have this problem with Next.js 14. I'm 100% sure that every single bit of my app is wrapped under MantineProvider, and this error shows up in Sentry from time to time. |
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.5.3
What package has an issue?
@mantine/notifications
What framework do you use?
Remix
In which browsers you can reproduce the issue?
Chrome
Describe the bug
The issue is described in this previously closed issue. I still have this problem, so I created a reproduction.
The project is pretty much an Epic Stack template. There are many files, but they are not relevant here. I kept all of my dependencies in the package.json file, maybe one of them is causing the issue. Also kept my root.tsx file mostly intact.
The error is the following:
The text was updated successfully, but these errors were encountered: