Skip to content

Commit 3e5a5f9

Browse files
committed
2 parents e916748 + c18d1f5 commit 3e5a5f9

34 files changed

+1747
-211
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ yarn-error.log*
3535
*.tsbuildinfo
3636
next-env.d.ts
3737
.env
38-
.env.sentry-build-plugin
3938

40-
cypress
39+
cypress
40+
# Sentry Config File
41+
.env.sentry-build-plugin

next.config.mjs

+40-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { withSentryConfig } from '@sentry/nextjs';
12
/** @type {import('next').NextConfig} */
23
import withBundleAnalyzer from '@next/bundle-analyzer';
34

@@ -27,9 +28,7 @@ const nextConfig = {
2728
'ssl.pstatic.net'
2829
]
2930
},
30-
3131
swcMinify: true,
32-
3332
compiler: {
3433
styledComponents: true
3534
},
@@ -48,4 +47,42 @@ const nextConfig = {
4847
}
4948
};
5049

51-
export default bundleAnalyzer(nextConfig);
50+
export default withSentryConfig(bundleAnalyzer(nextConfig), {
51+
// For all available options, see:
52+
// https://github.com/getsentry/sentry-webpack-plugin#options
53+
54+
org: 'moaguide',
55+
project: 'javascript-nextjs',
56+
57+
// Only print logs for uploading source maps in CI
58+
silent: !process.env.CI,
59+
60+
// For all available options, see:
61+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
62+
63+
// Upload a larger set of source maps for prettier stack traces (increases build time)
64+
widenClientFileUpload: true,
65+
66+
// Automatically annotate React components to show their full name in breadcrumbs and session replay
67+
reactComponentAnnotation: {
68+
enabled: true
69+
},
70+
71+
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
72+
// This can increase your server load as well as your hosting bill.
73+
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
74+
// side errors will fail.
75+
tunnelRoute: '/monitoring',
76+
77+
// Hides source maps from generated client bundles
78+
hideSourceMaps: true,
79+
80+
// Automatically tree-shake Sentry logger statements to reduce bundle size
81+
disableLogger: true,
82+
83+
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
84+
// See the following for more information:
85+
// https://docs.sentry.io/product/crons/
86+
// https://vercel.com/docs/cron-jobs
87+
automaticVercelMonitors: true
88+
});

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"cypress:open": "cypress open"
1212
},
1313
"dependencies": {
14+
"@sentry/nextjs": "8",
1415
"@tailwindcss/line-clamp": "^0.4.4",
1516
"@tanstack/react-query": "^5.59.19",
1617
"@tanstack/react-query-devtools": "4",

sentry.properties

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
defaults.url=https://sentry.io/
2+
defaults.org=YOUR_ORGANIZATION
3+
defaults.project=YOUR_PROJECT_NAME
4+
5+
auth.token=YOUR_AUTH_TOKEN
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { NextResponse } from "next/server";
2+
3+
export const dynamic = "force-dynamic";
4+
5+
// A faulty API route to test Sentry's error monitoring
6+
export function GET() {
7+
throw new Error("Sentry Example API Route Error");
8+
return NextResponse.json({ data: "Testing Sentry Error..." });
9+
}

src/app/global-error.tsx

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"use client";
2+
3+
import * as Sentry from "@sentry/nextjs";
4+
import NextError from "next/error";
5+
import { useEffect } from "react";
6+
7+
export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
8+
useEffect(() => {
9+
Sentry.captureException(error);
10+
}, [error]);
11+
12+
return (
13+
<html>
14+
<body>
15+
{/* `NextError` is the default Next.js error page component. Its type
16+
definition requires a `statusCode` prop. However, since the App Router
17+
does not expose status codes for errors, we simply pass 0 to render a
18+
generic error message. */}
19+
<NextError statusCode={0} />
20+
</body>
21+
</html>
22+
);
23+
}

src/app/layout.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import GnbWrapper from '@/components/common/GnbWrapper';
1111

1212
import './plugin';
1313
import NaverAnalytics from '@/lib/NaverAnalytics';
14+
import AuthWrapper from '@/components/common/AuthWrapper';
1415

1516
declare global {
1617
interface Window {
@@ -96,6 +97,7 @@ export default function RootLayout({
9697
strategy="beforeInteractive"
9798
src={`//dapi.kakao.com/v2/maps/sdk.js?appkey=${process.env.NEXT_PUBLIC_MAP_KEY}&autoload=false`}
9899
/>
100+
{/* <AuthWrapper /> */}
99101
<GnbWrapper />
100102
{children}
101103
<MobileFooter />

src/app/payment/check/confirm/success/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async function getPayment({ paymentKey, orderId, amount }: PaymentRequestProps)
8484

8585
return {
8686
redirect: {
87-
destination: `/payments/fail?code=${err.code}&message=${err.message}&orderId=${orderId}`
87+
destination: `payment/check/confirm/fail?code=${err.code}&message=${err.message}&orderId=${orderId}`
8888
}
8989
};
9090
}

src/app/product/detail/art/[id]/page.tsx

+17-10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ import ArtProductDetail from '@/components/product/detail/art/ArtProductDetail';
1010
import '../../../../plugin';
1111
import { BookmarkUpdate } from '@/components/product/detail/BookmarkUpdate';
1212
import { ArtTopDetail } from '@/components/product/detail/art/ArtTopDetail';
13+
import dynamic from 'next/dynamic';
14+
15+
const BlurWrapper = dynamic(() => import('@/components/common/BlurWrapper'), {
16+
ssr: false
17+
});
18+
1319
const ArtDetailpage = (props: { params: { id: string } }) => {
1420
const [sort, setSort] = useState('profit');
1521
const url = props.params.id;
@@ -27,16 +33,17 @@ const ArtDetailpage = (props: { params: { id: string } }) => {
2733
/>
2834
</Container>
2935
<NavBar sort={sort} setSort={setSort} />
30-
31-
{sort === 'news' ? (
32-
<News />
33-
) : sort === 'report' ? (
34-
<Report />
35-
) : sort === 'profit' ? (
36-
<ArtProfit url={url} />
37-
) : sort === 'detail' ? (
38-
<ArtProductDetail url={url} />
39-
) : undefined}
36+
<BlurWrapper>
37+
{sort === 'news' ? (
38+
<News />
39+
) : sort === 'report' ? (
40+
<Report />
41+
) : sort === 'profit' ? (
42+
<ArtProfit url={url} />
43+
) : sort === 'detail' ? (
44+
<ArtProductDetail url={url} />
45+
) : undefined}
46+
</BlurWrapper>
4047
</div>
4148
);
4249
};

src/app/product/detail/building/[id]/page.tsx

+22-16
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import { getBuildingProductDetail } from '@/factory/Product/ProductDetail/Buildi
1212
import '../../../../plugin';
1313
import { BookmarkUpdate } from '@/components/product/detail/BookmarkUpdate';
1414
import { BuildingTopDetail } from '@/components/product/detail/building/BuildingTopDetail';
15+
import dynamic from 'next/dynamic';
16+
17+
const BlurWrapper = dynamic(() => import('@/components/common/BlurWrapper'), {
18+
ssr: false
19+
});
1520

1621
const BuildingDetailpage = (props: { params: { id: string } }) => {
1722
const [sort, setSort] = useState('profit');
@@ -32,22 +37,23 @@ const BuildingDetailpage = (props: { params: { id: string } }) => {
3237
/>
3338
</Container>
3439
<NavBar sort={sort} setSort={setSort} />
35-
36-
{sort === 'public' ? (
37-
<Notice />
38-
) : sort === 'news' ? (
39-
<News />
40-
) : sort === 'report' ? (
41-
<Report />
42-
) : sort === 'profit' ? (
43-
<BuildingProfit url={url} />
44-
) : sort === 'detail' ? (
45-
<BuildingProductDetail
46-
url={url}
47-
rentType={data?.rentType}
48-
stayType={data?.stayType}
49-
/>
50-
) : undefined}
40+
<BlurWrapper>
41+
{sort === 'public' ? (
42+
<Notice />
43+
) : sort === 'news' ? (
44+
<News />
45+
) : sort === 'report' ? (
46+
<Report />
47+
) : sort === 'profit' ? (
48+
<BuildingProfit url={url} />
49+
) : sort === 'detail' ? (
50+
<BuildingProductDetail
51+
url={url}
52+
rentType={data?.rentType}
53+
stayType={data?.stayType}
54+
/>
55+
) : undefined}
56+
</BlurWrapper>
5157
</div>
5258
);
5359
};

src/app/product/detail/content/[id]/page.tsx

+25-14
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ import { getContentProductDetail } from '@/factory/Product/ProductDetail/Content
1010
import '../../../../plugin';
1111
import { BookmarkUpdate } from '@/components/product/detail/BookmarkUpdate';
1212
import { ContentTopDetail } from '@/components/product/detail/content/ContentTopDetail';
13+
import dynamic from 'next/dynamic';
14+
15+
const BlurWrapper = dynamic(() => import('@/components/common/BlurWrapper'), {
16+
ssr: false
17+
});
18+
1319
const ContentDetailpage = (props: { params: { id: string } }) => {
1420
const [sort, setSort] = useState('profit');
1521
const url = props.params.id;
@@ -30,20 +36,25 @@ const ContentDetailpage = (props: { params: { id: string } }) => {
3036
/>
3137
</Container>
3238
<NavBar sort={sort} setSort={setSort} />
33-
34-
{sort === 'news' ? (
35-
<News />
36-
) : sort === 'report' ? (
37-
<Report />
38-
) : sort === 'profit' ? (
39-
<ContentProfit
40-
url={url}
41-
invest={data?.invest as boolean}
42-
genre={data?.genre as string}
43-
/>
44-
) : sort === 'detail' ? (
45-
<ContentProductDetail url={url} genre={data?.genre as string} name={data?.name} />
46-
) : undefined}
39+
<BlurWrapper>
40+
{sort === 'news' ? (
41+
<News />
42+
) : sort === 'report' ? (
43+
<Report />
44+
) : sort === 'profit' ? (
45+
<ContentProfit
46+
url={url}
47+
invest={data?.invest as boolean}
48+
genre={data?.genre as string}
49+
/>
50+
) : sort === 'detail' ? (
51+
<ContentProductDetail
52+
url={url}
53+
genre={data?.genre as string}
54+
name={data?.name}
55+
/>
56+
) : undefined}
57+
</BlurWrapper>
4758
</div>
4859
);
4960
};

src/app/product/detail/cow/[id]/page.tsx

+16-13
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ import Container from '@/components/common/Container';
33
import NavBar from '@/components/product/detail/NavBar';
44
import News from '@/components/product/detail/News';
55
import Report from '@/components/product/detail/Report';
6-
import Image from 'next/image';
76
import { useState } from 'react';
87
import { getCowProductDetail } from '@/factory/Product/ProductDetail/CowProductDetail';
98
import CowProductDetail from '@/components/product/detail/cow/CowProductDetail';
109
import CowProfit from '@/components/product/detail/cow/CowProfit';
11-
import { CATEGORY } from '@/static/category';
12-
import Link from 'next/link';
1310
import '../../../../plugin';
1411
import { BookmarkUpdate } from '@/components/product/detail/BookmarkUpdate';
1512
import { CowTopDetail } from '@/components/product/detail/cow/CowTopDetail';
13+
import dynamic from 'next/dynamic';
14+
15+
const BlurWrapper = dynamic(() => import('@/components/common/BlurWrapper'), {
16+
ssr: false
17+
});
1618

1719
const CowDetailpage = (props: { params: { id: string } }) => {
1820
const [sort, setSort] = useState('profit');
@@ -33,16 +35,17 @@ const CowDetailpage = (props: { params: { id: string } }) => {
3335
/>
3436
</Container>
3537
<NavBar sort={sort} setSort={setSort} />
36-
37-
{sort === 'news' ? (
38-
<News />
39-
) : sort === 'report' ? (
40-
<Report />
41-
) : sort === 'profit' ? (
42-
<CowProfit url={url} />
43-
) : sort === 'detail' ? (
44-
<CowProductDetail url={url} />
45-
) : undefined}
38+
<BlurWrapper>
39+
{sort === 'news' ? (
40+
<News />
41+
) : sort === 'report' ? (
42+
<Report />
43+
) : sort === 'profit' ? (
44+
<CowProfit url={url} />
45+
) : sort === 'detail' ? (
46+
<CowProductDetail url={url} />
47+
) : undefined}
48+
</BlurWrapper>
4649
</div>
4750
);
4851
};

src/app/product/detail/music/[id]/page.tsx

+16-9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import MusicProductDetail from '@/components/product/detail/music/MusicProductDe
1010
import '../../../../plugin';
1111
import { BookmarkUpdate } from '@/components/product/detail/BookmarkUpdate';
1212
import { MusicTopDetail } from '@/components/product/detail/music/MusicTopDetail';
13+
import dynamic from 'next/dynamic';
14+
15+
const BlurWrapper = dynamic(() => import('@/components/common/BlurWrapper'), {
16+
ssr: false
17+
});
1318

1419
const MusicDetailpage = (props: { params: { id: string } }) => {
1520
const [sort, setSort] = useState('profit');
@@ -31,15 +36,17 @@ const MusicDetailpage = (props: { params: { id: string } }) => {
3136
</Container>
3237
<NavBar sort={sort} setSort={setSort} />
3338

34-
{sort === 'news' ? (
35-
<News />
36-
) : sort === 'report' ? (
37-
<Report />
38-
) : sort === 'profit' ? (
39-
<MusicProfit url={url} />
40-
) : sort === 'detail' ? (
41-
<MusicProductDetail />
42-
) : undefined}
39+
<BlurWrapper>
40+
{sort === 'news' ? (
41+
<News />
42+
) : sort === 'report' ? (
43+
<Report />
44+
) : sort === 'profit' ? (
45+
<MusicProfit url={url} />
46+
) : sort === 'detail' ? (
47+
<MusicProductDetail />
48+
) : undefined}
49+
</BlurWrapper>
4350
</div>
4451
);
4552
};

0 commit comments

Comments
 (0)