Suppress Next 15 Errors
Answered
American black bear posted this in #help-forum
American black bearOP
Hey, is there any way to suppress these errors and keep them to the browser console? Since Next 15 a lotta stuff on our platform needs to be updated, but it's dependent on libraries that haven't gotten rid of forwardRef yet for example. App works on dev/production, so looking for a more incremental way to adjust stuff.
Answered by African Slender-snouted Crocodile
I'm tempted to say no... maybe you can ask for it in an Issue but not sure if it would be considered or not.
The line that creates the error overlay is here: [next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx](https://github.com/vercel/next.js/blob/250370a0f897ead7fc66a460490e5897ccd18ab0/packages/next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx#L78) and to have them not show you'd need the
When you click the 'x' inside the indicator, it sets the displayState to hidden [here](https://github.com/vercel/next.js/blob/250370a0f897ead7fc66a460490e5897ccd18ab0/packages/next/src/client/components/react-dev-overlay/internal/container/Errors.tsx#L256), but I don't see any configuration or env vars that might change the default initial state.
The line that creates the error overlay is here: [next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx](https://github.com/vercel/next.js/blob/250370a0f897ead7fc66a460490e5897ccd18ab0/packages/next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx#L78) and to have them not show you'd need the
initialDisplayState to be 'hidden', I think.When you click the 'x' inside the indicator, it sets the displayState to hidden [here](https://github.com/vercel/next.js/blob/250370a0f897ead7fc66a460490e5897ccd18ab0/packages/next/src/client/components/react-dev-overlay/internal/container/Errors.tsx#L256), but I don't see any configuration or env vars that might change the default initial state.
12 Replies
<div suppressHydrationWarning={true}>
{/* content that might differ between server and client */}
</div>American black bearOP
That doesn't work @"use php"
it only suppresses hygration warnings. not any other warnings
American black bearOP
I understand that already, but my question is how do I get rid of that enforced error on Next 15 (same way it was on Next 14 where they'd only show in the browser console)
African Slender-snouted Crocodile
I'm tempted to say no... maybe you can ask for it in an Issue but not sure if it would be considered or not.
The line that creates the error overlay is here: [next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx](https://github.com/vercel/next.js/blob/250370a0f897ead7fc66a460490e5897ccd18ab0/packages/next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx#L78) and to have them not show you'd need the
When you click the 'x' inside the indicator, it sets the displayState to hidden [here](https://github.com/vercel/next.js/blob/250370a0f897ead7fc66a460490e5897ccd18ab0/packages/next/src/client/components/react-dev-overlay/internal/container/Errors.tsx#L256), but I don't see any configuration or env vars that might change the default initial state.
The line that creates the error overlay is here: [next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx](https://github.com/vercel/next.js/blob/250370a0f897ead7fc66a460490e5897ccd18ab0/packages/next/src/client/components/react-dev-overlay/app/ReactDevOverlay.tsx#L78) and to have them not show you'd need the
initialDisplayState to be 'hidden', I think.When you click the 'x' inside the indicator, it sets the displayState to hidden [here](https://github.com/vercel/next.js/blob/250370a0f897ead7fc66a460490e5897ccd18ab0/packages/next/src/client/components/react-dev-overlay/internal/container/Errors.tsx#L256), but I don't see any configuration or env vars that might change the default initial state.
Answer
@American black bear I understand that already, but my question is how do I get rid of that enforced error on Next 15 (same way it was on Next 14 where they'd only show in the browser console)
There is no way to do that.
There are some changes in next 15, and you need to modify the code for it.
I think you need to await headers
There are some changes in next 15, and you need to modify the code for it.
I think you need to await headers
@"use php" There is no way to do that.
There are some changes in next 15, and you need to modify the code for it.
I think you need to await headers
American black bearOP
Yeah but the problem is coming from a 3rd party library which if updated breaks the entire app. So we'll have to incrementally adopt Next 15, there's 9 micro front ends here so we can't just flick a wand and make them bring them all up to speed.
Yup, I guess you've to do that only.
incrementally adopt next 15
Mark solution please
Mark the message which resolved your issue
American black bearOP
Btw if anyone reading this si looking for a way to hide errors (and this is not recommended, it's just a personal preference to make DX easier during incremental adoption), I've had to set up a Boost in Arc Browser.
Hoping for a flag to optionally disable the nextjs errors from being thrown in the panel, or even better - to filter which kind of errors you wanna see (ignore forwardRef errors but keep others, etc.)
Hoping for a flag to optionally disable the nextjs errors from being thrown in the panel, or even better - to filter which kind of errors you wanna see (ignore forwardRef errors but keep others, etc.)