-
Notifications
You must be signed in to change notification settings - Fork 0
[INIT] Sentry & 디스코드 웹훅 초기 세팅 #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e6e07f9
chore(web): @sentry/nextjs 패키지 설치 (#24)
ehye1 2a6bdd5
init(web): Sentry 초기 세팅 (#24)
ehye1 f6b6edf
chore(root): turbo globalEnv에 Sentry 환경변수 추가 (#24)
ehye1 d8ea5d5
Merge branch 'develop' of https://github.com/Team-Timo/Timo-client in…
ehye1 01d05c4
fix(web): CI 린트 오류 수정 (#24)
ehye1 d554d49
chore(web): Sentry authToken 환경변수 설정 추가 (#24)
ehye1 e1ae8f2
chore(root): turbo build에 SENTRY_AUTH_TOKEN passThroughEnv 추가 (#24)
ehye1 71ed0ff
refactor(web): GlobalError를 default export 함수 선언으로 변경 (#24)
ehye1 c78d951
feat(web): GlobalError 에러 안내 문구 추가 (#24)
ehye1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| "use client"; | ||
|
|
||
| import * as Sentry from "@sentry/nextjs"; | ||
| import { useEffect } from "react"; | ||
|
|
||
| interface GlobalErrorProps { | ||
| error: Error & { digest?: string }; | ||
| reset: () => void; | ||
| } | ||
|
|
||
| export default function GlobalError({ error, reset }: GlobalErrorProps) { | ||
| useEffect(() => { | ||
| Sentry.captureException(error); | ||
| }, [error]); | ||
|
|
||
| return ( | ||
| <html lang="ko"> | ||
| <body> | ||
| <h1>문제가 발생했어요</h1> | ||
| <p>잠시 후 다시 시도해주세요.</p> | ||
| <button onClick={reset}>다시 시도</button> | ||
| </body> | ||
| </html> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import * as Sentry from "@sentry/nextjs"; | ||
|
|
||
| const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN; | ||
|
|
||
| if (dsn) { | ||
| Sentry.init({ | ||
| dsn, | ||
| environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local", | ||
| }); | ||
| } | ||
|
|
||
| export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import * as Sentry from "@sentry/nextjs"; | ||
|
|
||
| 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"); | ||
| } | ||
| } | ||
|
|
||
| export const onRequestError = Sentry.captureRequestError; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,16 @@ | ||
| /* global process */ | ||
| import { withSentryConfig } from "@sentry/nextjs"; | ||
|
|
||
| /** @type {import('next').NextConfig} */ | ||
| const nextConfig = { | ||
| transpilePackages: ["@repo/timo-design-system"], | ||
| }; | ||
|
|
||
| export default nextConfig; | ||
| export default withSentryConfig(nextConfig, { | ||
| org: "timo-client", | ||
| project: "timo-web", | ||
| authToken: process.env["SENTRY_AUTH_TOKEN"], | ||
| silent: !process.env.CI, | ||
|
ehye1 marked this conversation as resolved.
|
||
| widenClientFileUpload: true, | ||
| disableLogger: true, | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import * as Sentry from "@sentry/nextjs"; | ||
|
|
||
| const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN; | ||
|
|
||
| if (dsn) { | ||
| Sentry.init({ | ||
| dsn, | ||
| environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local", | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import * as Sentry from "@sentry/nextjs"; | ||
|
|
||
| const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN; | ||
|
|
||
| if (dsn) { | ||
| Sentry.init({ | ||
| dsn, | ||
| environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local", | ||
| }); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.