axiomhq / next-axiom

The official Next.js library for Axiom.
https://axiom.co/vercel
MIT License
356 stars 27 forks source link

Web-vitals 401 error #147

Open MathiasGruber opened 1 year ago

MathiasGruber commented 1 year ago

Hello,

I'm developing on the website www.theninja-rpg.com, which is bootstrapped with T3, adapted to use drizzle as ORM and clerk for auth.

I also have axiom setup and deployed using the vercel integration. Looking at the console, I see the following:

image

Am I doing something wrong? The project source is available at: https://github.com/MathiasGruber/TheNinjaRPG .. I'm pretty sure I've just followed the setup guide, but maybe there is some conflics with e.g. clerk?

schehata commented 12 months ago

Hi @MathiasGruber , usually that means that the integration token is not available. is this a production deployment? and it has been deployed after setting up the integration?

frankdavidcorona commented 8 months ago

Hi @MathiasGruber , usually that means that the integration token is not available. is this a production deployment? and it has been deployed after setting up the integration?

Hi @schehata

I'm facing the same issue and in my case, yes I'm running in production where my token should be exposed. I added next-axiom through Vercel Integration and the following steps described here for tailored logging: https://github.com/axiomhq/next-axiom

image

DC55137 commented 6 months ago

Hey MathiasGruber, I was getting the same warning. I added '/_axiom/web-vitals' to my publicRoutes in my middleware and the warning went away. As below:

//middleware.ts import { authMiddleware } from "@clerk/nextjs";

export default authMiddleware({ publicRoutes: [ "/", "/_axiom/web-vitals", // Add this line ], });

export const config = { matcher: ["/((?!.\..|_next).)", "/", "/(api|trpc)(.)"], };

I hope this helps.

voinik commented 2 months ago

Adding web vitals was causing my middleware (using Clerk) to be rerun infinitely. Adding @DC55137's suggestion fixed it for me!