1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 15:28:28 -04:00

remove sentry (might revisit later, idk yet)

This commit is contained in:
Jake Jarvis 2025-04-02 14:02:42 -04:00
parent 2b7f3c66a9
commit 774c3a5d96
Signed by: jake
SSH Key Fingerprint: SHA256:nCkvAjYA6XaSPUqc4TfbBQTpzr8Xj7ritg/sGInCdkc
10 changed files with 98 additions and 2083 deletions

View File

@ -3,7 +3,6 @@
import { headers } from "next/headers"; import { headers } from "next/headers";
import * as v from "valibot"; import * as v from "valibot";
import { Resend } from "resend"; import { Resend } from "resend";
import * as Sentry from "@sentry/nextjs";
import * as config from "../../lib/config"; import * as config from "../../lib/config";
const ContactSchema = v.object({ const ContactSchema = v.object({
@ -47,15 +46,10 @@ export type ContactState = {
}; };
export const sendMessage = async (prevState: ContactState, formData: FormData): Promise<ContactState> => { export const sendMessage = async (prevState: ContactState, formData: FormData): Promise<ContactState> => {
return await Sentry.withServerActionInstrumentation(
"sendMessage",
{
formData,
headers: headers(),
recordResponse: true,
},
async () => {
try { try {
// TODO: remove after debugging why automated spam entries are causing 500 errors
console.debug("[contact form] received data:", formData);
const data = v.safeParse(ContactSchema, Object.fromEntries(formData)); const data = v.safeParse(ContactSchema, Object.fromEntries(formData));
if (!data.success) { if (!data.success) {
@ -108,13 +102,11 @@ export const sendMessage = async (prevState: ContactState, formData: FormData):
return { success: true, message: "Thanks! You should hear from me soon." }; return { success: true, message: "Thanks! You should hear from me soon." };
} catch (error) { } catch (error) {
Sentry.captureException(error); console.error("[contact form] fatal error:", error);
return { return {
success: false, success: false,
message: "Internal server error. Please try again later or shoot me an email.", message: "Internal server error. Please try again later or shoot me an email.",
}; };
} }
}
);
}; };

View File

@ -1,14 +0,0 @@
"use client";
import { useEffect } from "react";
import * as Sentry from "@sentry/nextjs";
const Error = ({ error }: { error: Error & { digest?: string } }) => {
useEffect(() => {
Sentry.captureException(error);
}, [error]);
return <span>Something went very wrong! 😳</span>;
};
export default Error;

View File

@ -1,25 +0,0 @@
"use client";
import { useEffect } from "react";
import NextError from "next/error";
import * as Sentry from "@sentry/nextjs";
const GlobalError = ({ error }: { error: Error & { digest?: string } }) => {
useEffect(() => {
Sentry.captureException(error);
}, [error]);
return (
<html>
<body>
{/* `NextError` is the default Next.js error page component. Its type
definition requires a `statusCode` prop. However, since the App Router
does not expose status codes for errors, we simply pass 0 to render a
generic error message. */}
<NextError statusCode={0} />
</body>
</html>
);
};
export default GlobalError;

View File

@ -1,5 +1,4 @@
import { connection } from "next/server"; import { connection } from "next/server";
import * as Sentry from "@sentry/nextjs";
import commaNumber from "comma-number"; import commaNumber from "comma-number";
import CountUp from "../../../components/CountUp"; import CountUp from "../../../components/CountUp";
import redis from "../../../lib/helpers/redis"; import redis from "../../../lib/helpers/redis";
@ -22,7 +21,7 @@ const HitCounter = async ({ slug }: { slug: string }) => {
</span> </span>
); );
} catch (error) { } catch (error) {
Sentry.captureException(error); console.error("[hit counter] fatal error:", error);
return <span title="Error getting views! :(">?</span>; return <span title="Error getting views! :(">?</span>;
} }

View File

@ -1,7 +0,0 @@
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
integrations: [Sentry.browserTracingIntegration(), Sentry.httpClientIntegration()],
tracesSampleRate: 1.0,
});

View File

@ -1,23 +0,0 @@
import * as Sentry from "@sentry/nextjs";
export const onRequestError = Sentry.captureRequestError;
export const register = () => {
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN,
integrations: [Sentry.captureConsoleIntegration()],
tracesSampleRate: 1.0,
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#normalizeDepth
normalizeDepth: 5,
});
if (process.env.NEXT_RUNTIME === "nodejs") {
// filesystem is only available in nodejs runtime
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/integrations/fs/
Sentry.addIntegration(
Sentry.fsIntegration({
recordFilePaths: true,
})
);
}
};

View File

@ -44,7 +44,6 @@ const nextConfig: NextConfig = {
serverActions: { serverActions: {
allowedOrigins: ["jarv.is", "jarvis2i2vp4j4tbxjogsnqdemnte5xhzyi7hziiyzxwge3hzmh57zad.onion"], allowedOrigins: ["jarv.is", "jarvis2i2vp4j4tbxjogsnqdemnte5xhzyi7hziiyzxwge3hzmh57zad.onion"],
}, },
serverSourceMaps: true,
}, },
eslint: { eslint: {
dirs: ["app", "components", "contexts", "hooks", "lib", "notes"], dirs: ["app", "components", "contexts", "hooks", "lib", "notes"],
@ -210,23 +209,6 @@ const nextPlugins: Array<
], ],
}, },
}), }),
[
require("@sentry/nextjs").withSentryConfig,
{
// https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/build/
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
silent: !process.env.CI,
tunnelRoute: "/_stream/otel",
widenClientFileUpload: true,
disableLogger: true,
telemetry: false,
bundleSizeOptimizations: {
excludeDebugStatements: true,
},
},
],
]; ];
// eslint-disable-next-line import/no-anonymous-default-export // eslint-disable-next-line import/no-anonymous-default-export

View File

@ -27,7 +27,6 @@
"@next/mdx": "15.3.0-canary.29", "@next/mdx": "15.3.0-canary.29",
"@octokit/graphql": "^8.2.1", "@octokit/graphql": "^8.2.1",
"@octokit/graphql-schema": "^15.26.0", "@octokit/graphql-schema": "^15.26.0",
"@sentry/nextjs": "^9.10.1",
"@upstash/redis": "^1.34.6", "@upstash/redis": "^1.34.6",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"comma-number": "^2.1.0", "comma-number": "^2.1.0",
@ -75,7 +74,6 @@
"@eslint/eslintrc": "^3.3.1", "@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.23.0", "@eslint/js": "^9.23.0",
"@jakejarvis/eslint-config": "^4.0.7", "@jakejarvis/eslint-config": "^4.0.7",
"@sentry/cli": "^2.43.0",
"@types/comma-number": "^2.1.2", "@types/comma-number": "^2.1.2",
"@types/mdx": "^2.0.13", "@types/mdx": "^2.0.13",
"@types/node": "^22.13.17", "@types/node": "^22.13.17",
@ -131,7 +129,6 @@
}, },
"pnpm": { "pnpm": {
"onlyBuiltDependencies": [ "onlyBuiltDependencies": [
"@sentry/cli",
"sharp", "sharp",
"simple-git-hooks" "simple-git-hooks"
], ],

1959
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,6 @@
- Giscus - Giscus
- Resend - Resend
- Umami - Umami
- Sentry
- ...and more: https://jarv.is/uses - ...and more: https://jarv.is/uses
# VIEW SOURCE # VIEW SOURCE