Forcing light mode on Vercel (NextJS?) defaults #82576
Unanswered
shadowlion
asked this question in
Help
Replies: 1 comment
-
I'd say, maybe it is best to define your own global-not-found.tsx file, if you have the latest version https://nextjs.org/docs/app/api-reference/file-conventions/not-found#global-not-foundjs-experimental - and there you can use the Error from // src/components/CustomNotFound.tsx
'use client'
import Error from 'next/error'
export default function CustomNotFound() {
return <Error withDarkMode={false} statusCode={404} />
} Then define: // src/app/global-not-found.tsx
import { CustomNotFound } from '../components/CustomNotFound'
export default function GlobalNotFound() {
return <CustomNotFound />
} And make sure the flag is activated: import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
htmlLimitedBots: /.*/,
experimental: {
globalNotFound: true
}
};
export default nextConfig; And that'd should do the trick, you can see it here on this example I deployed:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Is there a way to force light mode (overriding System Settings and Dark Mode) for (app) pages that don't have a custom "Not Found" fallback? Using NextJS with Vercel deployments, and for dynamic routes that I attempt to access, but doesn't exist, it should give me the default 404 Not Found page. Also using TailwindCSS, but didn't know which configuration I should be attempting to refactor.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions