mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-26 09:25:22 -04:00
remove sentry (might revisit later, idk yet)
This commit is contained in:
parent
2b7f3c66a9
commit
774c3a5d96
@ -3,7 +3,6 @@
|
||||
import { headers } from "next/headers";
|
||||
import * as v from "valibot";
|
||||
import { Resend } from "resend";
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
import * as config from "../../lib/config";
|
||||
|
||||
const ContactSchema = v.object({
|
||||
@ -47,15 +46,10 @@ export type ContactState = {
|
||||
};
|
||||
|
||||
export const sendMessage = async (prevState: ContactState, formData: FormData): Promise<ContactState> => {
|
||||
return await Sentry.withServerActionInstrumentation(
|
||||
"sendMessage",
|
||||
{
|
||||
formData,
|
||||
headers: headers(),
|
||||
recordResponse: true,
|
||||
},
|
||||
async () => {
|
||||
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));
|
||||
|
||||
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." };
|
||||
} catch (error) {
|
||||
Sentry.captureException(error);
|
||||
console.error("[contact form] fatal error:", error);
|
||||
|
||||
return {
|
||||
success: false,
|
||||
message: "Internal server error. Please try again later or shoot me an email.",
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
@ -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;
|
@ -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;
|
@ -1,5 +1,4 @@
|
||||
import { connection } from "next/server";
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
import commaNumber from "comma-number";
|
||||
import CountUp from "../../../components/CountUp";
|
||||
import redis from "../../../lib/helpers/redis";
|
||||
@ -22,7 +21,7 @@ const HitCounter = async ({ slug }: { slug: string }) => {
|
||||
</span>
|
||||
);
|
||||
} catch (error) {
|
||||
Sentry.captureException(error);
|
||||
console.error("[hit counter] fatal error:", error);
|
||||
|
||||
return <span title="Error getting views! :(">?</span>;
|
||||
}
|
||||
|
@ -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,
|
||||
});
|
@ -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,
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
@ -44,7 +44,6 @@ const nextConfig: NextConfig = {
|
||||
serverActions: {
|
||||
allowedOrigins: ["jarv.is", "jarvis2i2vp4j4tbxjogsnqdemnte5xhzyi7hziiyzxwge3hzmh57zad.onion"],
|
||||
},
|
||||
serverSourceMaps: true,
|
||||
},
|
||||
eslint: {
|
||||
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
|
||||
|
@ -27,7 +27,6 @@
|
||||
"@next/mdx": "15.3.0-canary.29",
|
||||
"@octokit/graphql": "^8.2.1",
|
||||
"@octokit/graphql-schema": "^15.26.0",
|
||||
"@sentry/nextjs": "^9.10.1",
|
||||
"@upstash/redis": "^1.34.6",
|
||||
"clsx": "^2.1.1",
|
||||
"comma-number": "^2.1.0",
|
||||
@ -75,7 +74,6 @@
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@eslint/js": "^9.23.0",
|
||||
"@jakejarvis/eslint-config": "^4.0.7",
|
||||
"@sentry/cli": "^2.43.0",
|
||||
"@types/comma-number": "^2.1.2",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^22.13.17",
|
||||
@ -131,7 +129,6 @@
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"@sentry/cli",
|
||||
"sharp",
|
||||
"simple-git-hooks"
|
||||
],
|
||||
|
1959
pnpm-lock.yaml
generated
1959
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -34,7 +34,6 @@
|
||||
- Giscus
|
||||
- Resend
|
||||
- Umami
|
||||
- Sentry
|
||||
- ...and more: https://jarv.is/uses
|
||||
|
||||
# VIEW SOURCE
|
||||
|
Loading…
x
Reference in New Issue
Block a user