Skip to content

Commit

Permalink
Merge pull request #449 from tumugin/migrate-nextjs-15
Browse files Browse the repository at this point in the history
Fixed some issues by upgrading to Next.js 15
  • Loading branch information
tumugin authored Oct 29, 2024
2 parents 3d3dae5 + 7c2dfa3 commit f437ca6
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 31 deletions.
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 statusCode={0} />
</body>
</html>
)
}
2 changes: 0 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import React from 'react'
import { ColneRootStyled } from 'components/styled/ColneRootStyled'
import NextTopLoader from 'nextjs-toploader'
import { applicationName } from 'libs/app-const'
import { RevalidateServerComponentsHack } from 'components/next-utils/RevalidateServerComponents'
import { ServerColneAppWithLayout } from 'components/app/ServerColneAppWithLayout'

const inter = Inter({ subsets: ['latin'] })
Expand All @@ -24,7 +23,6 @@ export default async function RootLayout({
return (
<html lang="en">
<body className={inter.className}>
<RevalidateServerComponentsHack />
<NextTopLoader showSpinner={false} />
<StyledComponentsRegistry>
<ColneRootStyled>
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
"react-dom": "19.0.0-rc-02c0e824-20241028",
"react-hook-form": "^7.45.1",
"react-hot-toast": "^2.4.1",
"recharts": "^2.7.3",
"react-is": "19.0.0-rc-0bc30748-20241028",
"recharts": "^2.13.0",
"styled-components": "^6.0.4",
"yup": "^1.2.0"
},
"resolutions": {
"cross-fetch": "^4.0.0",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
"@types/react-dom": "npm:[email protected]",
"react-is": "19.0.0-rc-0bc30748-20241028"
},
"devDependencies": {
"@babel/core": "^7.22.9",
Expand Down
7 changes: 7 additions & 0 deletions sentry.edge.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as Sentry from '@sentry/nextjs'

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,
tracesSampleRate: 0.01,
})
34 changes: 7 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6817,7 +6817,8 @@ __metadata:
react-dom: "npm:19.0.0-rc-02c0e824-20241028"
react-hook-form: "npm:^7.45.1"
react-hot-toast: "npm:^2.4.1"
recharts: "npm:^2.7.3"
react-is: "npm:19.0.0-rc-0bc30748-20241028"
recharts: "npm:^2.13.0"
storybook: "npm:^8.0.0"
storybook-dark-mode: "npm:^4.0.0"
styled-components: "npm:^6.0.4"
Expand Down Expand Up @@ -12812,31 +12813,10 @@ __metadata:
languageName: node
linkType: hard

"react-is@npm:18.1.0":
version: 18.1.0
resolution: "react-is@npm:18.1.0"
checksum: 10c0/558874e4c3bd9805a9294426e090919ee6901be3ab07f80b997c36b5a01a8d691112802e7438d146f6c82fd6495d8c030f276ef05ec3410057f8740a8d723f8c
languageName: node
linkType: hard

"react-is@npm:^16.13.1, react-is@npm:^16.7.0, react-is@npm:^16.8.6":
version: 16.13.1
resolution: "react-is@npm:16.13.1"
checksum: 10c0/33977da7a5f1a287936a0c85639fec6ca74f4f15ef1e59a6bc20338fc73dc69555381e211f7a3529b8150a1f71e4225525b41b60b52965bda53ce7d47377ada1
languageName: node
linkType: hard

"react-is@npm:^17.0.1":
version: 17.0.2
resolution: "react-is@npm:17.0.2"
checksum: 10c0/2bdb6b93fbb1820b024b496042cce405c57e2f85e777c9aabd55f9b26d145408f9f74f5934676ffdc46f3dcff656d78413a6e43968e7b3f92eea35b3052e9053
languageName: node
linkType: hard

"react-is@npm:^18.3.1":
version: 18.3.1
resolution: "react-is@npm:18.3.1"
checksum: 10c0/f2f1e60010c683479e74c63f96b09fb41603527cd131a9959e2aee1e5a8b0caf270b365e5ca77d4a6b18aae659b60a86150bb3979073528877029b35aecd2072
"react-is@npm:19.0.0-rc-0bc30748-20241028":
version: 19.0.0-rc-0bc30748-20241028
resolution: "react-is@npm:19.0.0-rc-0bc30748-20241028"
checksum: 10c0/0b66504d7c6a4e48e017aa065b313ccd525bcc67e042a02bcb41133d6c61da8f2dde0b6c628eb757c4bf81393cfd46837b5fc1a71878c011b1e70ac4f5b761fa
languageName: node
linkType: hard

Expand Down Expand Up @@ -12980,7 +12960,7 @@ __metadata:
languageName: node
linkType: hard

"recharts@npm:^2.7.3":
"recharts@npm:^2.13.0":
version: 2.13.0
resolution: "recharts@npm:2.13.0"
dependencies:
Expand Down

0 comments on commit f437ca6

Please sign in to comment.