Replies: 2 comments
-
Random additional input here: It would be crucial to have something similar to the |
Beta Was this translation helpful? Give feedback.
-
Also interested in sending otel traces from client side. Would be nice in Next.js did that as adding tracing to the frontend code is currently complicated:
Having end-to-end traces could nice |
Beta Was this translation helpful? Give feedback.
-
Goals
Allow to register client-only code in
instrumentation.ts
.Background
instrumentation.ts
is currently available for code that executes in Node.js and Edge. However, as far as I know, there is currently no equivalent that is called for the client side.Error-tracking libraries like Sentry currently enable client-side instrumentation, by wrapping each client-side entry point and injecting a custom script into the build.
While this works, I'd argue it's somewhat brittle and also requires quite some custom logic to work. Instead, I'd find it very helpful if Next.js would expose a built-in way that covers this.
My particular use case is adapting the error handling capabilities of
next-intl
to register a global error handler that is automatically called in all environments if registered ininstrumentation.ts
./cc @lforst in case you're interested in this too
Related: #57563
Proposal
Beta Was this translation helpful? Give feedback.
All reactions