Troubleshooting
This guide provides solutions to common issues encountered when setting up or running Noxion. If you encounter an error not listed here, check the browser console and server logs for specific error messages.
Notion API Issues
Pages don't appear or site is empty
| Cause | Solution |
|---|---|
Wrong NOTION_PAGE_ID | Ensure the ID matches the root page of your site. It should be a 32-character string. |
| Page not shared | If not using a NOTION_TOKEN, the page must be "Public". If using a token, the integration must be invited to the page. |
| Private page without token | Ensure NOTION_TOKEN is set in your environment variables if the page is private. |
"Unauthorized" (401) errors
Problem: The build fails or pages return 401 errors.
Cause: The NOTION_TOKEN is invalid, expired, or the integration hasn't been granted access to the specific page.
Solution:
- Verify the token in the Notion Developers portal.
- In Notion, click the "..." menu on your root page, go to "Connect to", and select your integration.
Stale content
Problem: Changes in Notion are not reflecting on the live site. Cause: The ISR (Incremental Static Regeneration) cache hasn't expired yet, or the revalidation trigger failed. Solution:
- Wait for the
revalidateinterval (default 3600s) to pass. - Trigger a manual revalidation if you have a revalidation endpoint configured.
- Check if your hosting provider (like Vercel) is correctly handling the
Cache-Controlheaders.
Build Issues
"Cannot find module" errors
Problem: Build fails with module resolution errors. Cause: Missing dependencies or a corrupted lockfile. Solution:
- Delete
node_modulesand your lockfile (package-lock.jsonorpnpm-lock.yaml). - Run
npm installorpnpm install. - Ensure you are using the Node.js version specified in
.nvmrcorpackage.json.
Build fails with type errors
Problem: TypeScript errors during next build.
Cause: Version mismatch between @noxion packages or outdated local types.
Solution:
- Ensure all
@noxion/*packages in yourpackage.jsonuse the same version. - Run
npx tsc --noEmitto debug specific files. - If using custom plugins, verify they match the
NoxionPlugininterface.
Build is slow
Problem: The build process takes several minutes or times out. Cause: Too many images being downloaded or too many Shiki languages being loaded. Solution:
- Set
NOXION_DOWNLOAD_IMAGES=falseto proxy images at runtime instead of downloading them. - Limit
shiki.langsinnoxion.config.tsto only the languages you actually use.
Runtime Issues
Flash of Unstyled Content (FOUC)
Problem: The site flickers or shows wrong colors for a split second on load.
Cause: The ThemeScript component is missing from the root layout, or it's placed after the main content.
Solution:
Place the ThemeScript at the very top of your <body> tag in app/layout.tsx.
// app/layout.tsx
export default function RootLayout({ children }) {
return (
<html>
<body>
<ThemeScript />
{children}
</body>
</html>
);
}
Dark mode not working
Problem: Toggling dark mode has no effect.
Cause: The data-theme attribute is not being applied to the <html> or <body> tag, or Tailwind is not configured for the data-theme selector.
Solution:
- Inspect the DOM to see if
<html data-theme="dark">exists. - Check your
tailwind.config.tsfor the correct theme strategy.
Math equations not rendering
Problem: LaTeX code appears as plain text. Cause: Missing KaTeX CSS or the math plugin is not enabled. Solution:
- Import the KaTeX CSS in your global CSS file or root layout.
- Ensure
remark-mathandrehype-katexare included in your processor pipeline.
/* globals.css */
@import 'katex/dist/katex.min.css';
Deployment Issues
Vercel: ISR not working
Problem: Pages never update after the initial build.
Cause: Environment variables are missing in the Vercel dashboard, or the revalidate constant is being overridden.
Solution:
- Check the "Environment Variables" tab in Vercel.
- Ensure
NOTION_TOKENandNOTION_PAGE_IDare present for the "Production" environment. - Check Vercel logs for "Function Invocation" errors during revalidation.
Docker: Broken images
Problem: Images show as broken icons when self-hosting.
Cause: Missing remotePatterns in next.config.ts or CORS issues with the Notion S3 proxy.
Solution:
Add the Notion S3 domains to your next.config.ts:
// next.config.ts
images: {
remotePatterns: [
{ protocol: 'https', hostname: 's3.us-west-2.amazonaws.com' },
{ protocol: 'https', hostname: 'prod-files-secure.s3.us-west-2.amazonaws.com' },
],
},
Plugin Issues
Plugin not loading
Problem: A custom block or functionality is missing. Cause: Wrong plugin order or the plugin was not imported in the renderer. Solution:
- Verify the plugin is exported in your
noxion.config.ts. - Check the order: plugins are processed sequentially; a generic plugin might be "swallowing" a specific block before your custom plugin sees it.
Analytics not tracking
Problem: No data appears in your analytics dashboard.
Cause: NODE_ENV is not production, or the tracking ID is missing the NEXT_PUBLIC_ prefix.
Solution:
- Ensure your environment variable is named
NEXT_PUBLIC_GA_ID(or similar). - Most analytics plugins disable themselves in development mode to avoid polluting data. Test in a production build.
Always check the browser's Network tab to see if the analytics script is actually being requested.