axiomhq/next-axiom

axiom/web-vitals 403 error on localhost

jinsley8 opened this issue · 3 comments

I setup next-axiom as outlined but I'm seeing the following browser console error on localhost:

POST http://localhost:3000/_axiom/web-vitals 403 (Forbidden) - webVitals.js

Is this a bug or should I just conditionally export reportWebVitals in _app.ts on production only?

I'm only interested in the production logs on Vercel which work fine.

Screenshot 2023-01-10 at 7 20 09 PM

@jinsley8 on localhost web-vitals shouldn't try to send anything. Do you have any axiom related env variable set on localhost? like AXIOM_TOKEN for example, or NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT? If there are env vars set webVitals will try to send. Can you double check and let me know.

Yes NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT was set. I will disable and works good now.

Thanks

awesome! glad I could help.

I will close this for now since everything is fine, feel free to open again or create a new issue if something comes up.