-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
8.32.0
Framework Version
Next.js 14.2.12
Link to Sentry event
Reproduction Example/SDK Setup
import { type Options, type Integration } from "@sentry/types";
const sentryConfig: Options & { integrations: Integration[] } = {
dsn: "https://[email protected]/234235",
release: `cambly-frontend@development`,
environment: "development",
debug: true,
allowUrls: [
"webpack-internal://",
"localhost:8080",
"localhost:8084",
],
integrations: [],
beforeSend: (event) => {
// For debugging
console.log("///// event beforeSend", {
tags: event.tags ? JSON.stringify(Object.keys(event.tags)) : null,
});
return event;
},
tracesSampler(): number {
return process.env.NODE_ENV !== "production" ? 1 : 0.05;
},
};
Steps to Reproduce
- Create a
app/error.tsx
file:
"use client";
import { useEffect, type ReactElement } from "react";
import * as Sentry from "@sentry/nextjs";
export default function Error({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}): ReactElement {
console.log("///// captured before", error.__sentry_captured__);
useEffect(() => {
Sentry.withScope((scope) => {
scope.clear();
scope.setTag("cambly.captureLocationTemp", "nextjsPageErrorAppError");
Sentry.captureException(error);
});
}, [error]);
return (
<h2>
Something went wrong{" "}
<button onClick={() => reset()} type="button">
Reset
</button>
</h2>
);
}
- Create a page route
app/page.tsx
:
"use client";
import { type ReactElement } from "react";
import { useSearchParams } from "next/navigation";
export default function Page(): ReactElement {
const throwErrorIntentionally = useSearchParams().get("throwErrorIntentionally");
if (throwErrorIntentionally === "true") {
throw new Error("TEST_ERROR_DEFG_1234");
}
return (
<h1>Test</h1>
);
}
Expected Result
Error contains cambly.captureLocationTemp
tag
Actual Result
Error does not contain cambly.captureLocationTemp
Metadata
Metadata
Assignees
Labels
Projects
Status
No status