Nextra with Vercel Analytics
Answered
Cornish Rex posted this in #help-forum
Cornish RexOP
Hi All, I'm trying to deploy a Nextra site with Vercel analytics, and keep getting a 404 error. Does anyone have any experience debugging Vercel Analytics, and know how to fix this?
- I've enabled Analytics
- Redployed
- Promoted to production
Here is how I'm importing it:
And my folder structure is in the attached image
- I've enabled Analytics
- Redployed
- Promoted to production
Here is how I'm importing it:
import { Analytics } from "@vercel/analytics/react";
import { SessionProvider } from "next-auth/react";
import "../globals.css";
export default function MyApp({
Component,
pageProps,
}: {
Component: any;
pageProps: any;
}) {
const { session, ...rest } = pageProps;
return (
<>
<SessionProvider session={pageProps.session}>
<Component {...rest} />
</SessionProvider>
<Analytics />
</>
);
}And my folder structure is in the attached image
Answered by Cornish Rex
Once I created a custom domain, and no longer pointed to the default
*.vercel.app domain, analytics were loading correctly.1 Reply
Cornish RexOP
Once I created a custom domain, and no longer pointed to the default
*.vercel.app domain, analytics were loading correctly.Answer