Skip to content

Commit

Permalink
bump next
Browse files Browse the repository at this point in the history
Signed-off-by: Frances Coronel <[email protected]>
  • Loading branch information
FrancesCoronel committed Jul 21, 2024
1 parent 9ebc56c commit 770a8cd
Show file tree
Hide file tree
Showing 11 changed files with 1,171 additions and 386 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ next-env.d.ts

# Sentry Auth Token
.sentryclirc

# Sentry Config File
.env.sentry-build-plugin
11 changes: 4 additions & 7 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ const config: StorybookConfig = {
],

addons: [
"@storybook/addon-links",
"@chromatic-com/storybook",
"@storybook/addon-a11y",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-links",
"@storybook/addon-storysource",
"@storybook/addon-a11y",
"@chromatic-com/storybook"
"@storybook/addon-styling",
],

framework: {
Expand All @@ -37,9 +38,5 @@ const config: StorybookConfig = {
staticDirs: ["../public"],

docs: {},

typescript: {
reactDocgen: "react-docgen-typescript"
}
};
export default config;
9 changes: 9 additions & 0 deletions app/api/sentry-example-api/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { NextResponse } from "next/server";

export const dynamic = "force-dynamic";

// A faulty API route to test Sentry's error monitoring
export function GET() {
throw new Error("Sentry Example API Route Error");
return NextResponse.json({ data: "Testing Sentry Error..." });
}
23 changes: 23 additions & 0 deletions app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use client";

import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";

export default function 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>
);
}
9 changes: 9 additions & 0 deletions instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
await import('./sentry.server.config');
}

if (process.env.NEXT_RUNTIME === 'edge') {
await import('./sentry.edge.config');
}
}
27 changes: 16 additions & 11 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,34 @@ module.exports = withSentryConfig(
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,

org: "latina-dev",
project: "latina-dev"
},
{
project: "latina-dev",

// Only print logs for uploading source maps in CI
silent: !process.env.CI,

// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
}
);
Loading

0 comments on commit 770a8cd

Please sign in to comment.