Troubleshooting & FAQ
Known limitations and fixes for common problems.
The toolbar disappears when a page throws
When no error.tsx catches a render error, Next replaces the whole root layout with its own error page ("This page couldn't load"), toolbar included. Render the toolbar in app/global-error.tsx as well; it reconnects and shows the 500 and the failing request:
'use client'
import { NextToolbar } from '@angelitolm/next-toolbar'
export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
return (
<html lang="en">
<body>
<h1>Something went wrong</h1>
<p>{error.digest ?? error.message}</p>
<NextToolbar />
</body>
</html>
)
}See Getting started.
The render mode says Static but production is dynamic
Dev can only see request APIs and force-dynamic. A no-store fetch or a dynamic segment without generateStaticParams looks static in dev. NextToolbar catches the no-store case with request insights and marks dynamic segments Static?. Run next build for the definitive answer. See Render mode.
The render mode shows ?
One of:
- the page returned 4xx/5xx (render mode isn't shown for error responses);
- the toolbar isn't connected to the dev server: hover the Next version and check HMR socket;
- your app uses Cache Components, for which Next doesn't send static/dynamic data.
The status shows —
The browser doesn't expose responseStatus (Safari), or the page came from the browser's back/forward cache.
No server time, fetches or profiler
You're on a Next version before 16.3, or experimental.requestInsights isn't enabled in next.config. The time segment's panel shows a hint when this is the case. See Configuration.
Next's "N" indicator covers the toolbar
Move it or turn it off:
devIndicators: { position: 'top-right' } // or: devIndicators: falseThe request list is too noisy
It collects requests from every page, reload and tab, plus route handlers and prefetches. Use Clear in the profiler: it keeps only the current page's request. See Profiler → Clear.
Cleared requests came back
The toolbar hides requests that started before you cleared, comparing the dev server's clock with the browser's. With a remote dev server whose clock is behind, a few may reappear.
The route pattern is wrong before Next 16.3
Without request insights the pattern is rebuilt from the URL and useParams(). A param whose value equals a static segment (/blog/blog) can be mislabeled. Next 16.3+ with request insights gives the exact pattern.
The toolbar doesn't show on a staging server
Check, in order:
- The server route is mounted at
app/api/next-toolbar/route.ts. Without it nobody can let the browser in. NEXT_TOOLBAR_SECRETis set on the server process and has at least 16 characters. It's read at runtime, so restartnext startafter changing it. It must not be aNEXT_PUBLIC_variable.- The cookie is there: in DevTools → Application → Cookies, a
next-toolbarcookie for this domain withpath=/, holding exactly the same value. - The route answers: in the DevTools console,
fetch('/api/next-toolbar', { headers: { 'x-next-toolbar': '1' } }).then((r) => r.status).404means one of the above is wrong (or a proxy blocks/api/next-toolbar);200means the toolbar should load on the next reload. basePath: the route lives under it (/docs/api/next-toolbar), and the cookie'spathmust cover it.
The cached fetch list is empty on staging
The list is read from .next/cache/fetch-cache on the server's disk. It stays empty on Vercel and other serverless platforms, with a custom cacheHandler, with a custom distDir, or before any page has cached a fetch. Fetches with no-store are never listed. See Fetch cache.
Does it affect production?
No. Outside next dev the component returns null: no rendering, no socket, no listeners, and pages don't load the toolbar's code. The only exception is a staging server your team opts in on purpose; see Staging.
Does it work with basePath?
Yes, with no configuration. See Configuration → basePath.
Does it work with the Pages Router?
No. NextToolbar is built for the App Router (it relies on next/navigation hooks and RSC requests).