Coder Social home page Coder Social logo

Comments (3)

tobiaslins avatar tobiaslins commented on April 30, 2024

Hey @A7med3bdulBaset !

Did you resolve this issue already? This should work fine. If not, please send us a reproducible example!

Thanks

from analytics.

A7med3bdulBaset avatar A7med3bdulBaset commented on April 30, 2024

@tobiaslins
It's still not resolved

I think what we need is not a reproducible repo since the problem is not in the code but in Vercel.

To produce it:

  1. run create-next-app
  2. deploy to Vercel
  3. turn on Vercel analytics
  4. copy this code to error.tsx
'use client'

import { track } from '@vercel/analytics';
// ...

export default function Error({
  error,
  reset
}: {
  error: Error;
  reset: () => void;
}) {
  useEffect(() => {
    track('thrown-error', { message: error.message, time: new Date().toLocaleString() });
  }, [error.message]);

  return // jsx
}
  1. finally in any page throw new Error("should be tracked")

from analytics.

tobiaslins avatar tobiaslins commented on April 30, 2024

Hey @A7med3bdulBaset

I just added a example for error tracking (same as you mentioned) and it works fine
https://github.com/vercel/analytics/pull/113/files

Also the deployed version does work for us.
image

Make sure adblockers are not blocking the script on production!

from analytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.