astronomy-club-at-nitic / nitic-astronomy

The website of Astronomy Club at NITIC.
https://nitic-astronomy-website.vercel.app
MIT License
2 stars 0 forks source link

全てのフォントに対してGoogle Fontsを利用するようにした。また、アイコンを圧縮した。 #170

Closed ReoHakase closed 1 year ago

ReoHakase commented 1 year ago

最適化後のパフォーマンス

next startで計測

image

十分でないtimeoutに対するworkaround

Possible Temporal Fix

AbortError: The user aborted a request.
    at abort (/Users/ReoHakase/repos/nitic-astronomy/node_modules/.pnpm/next@13.3.4_@babel+core@7.21.4_react-dom@18.2.0_react@18.2.0_sass@1.62.1/node_modules/next/dist/compiled/node-fetch/index.js:1:65190)
    at EventTarget.abortAndFinalize (/Users/ReoHakase/repos/nitic-astronomy/node_modules/.pnpm/next@13.3.4_@babel+core@7.21.4_react-dom@18.2.0_react@18.2.0_sass@1.62.1/node_modules/next/dist/compiled/node-fetch/index.js:1:65410)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:735:20)
    at EventTarget.dispatchEvent (node:internal/event_target:677:26)
    at abortSignal (node:internal/abort_controller:308:10)
    at AbortController.abort (node:internal/abort_controller:338:5)
    at Timeout.<anonymous> (/Users/ReoHakase/repos/nitic-astronomy/node_modules/.pnpm/next@13.3.4_@babel+core@7.21.4_react-dom@18.2.0_react@18.2.0_sass@1.62.1/node_modules/next/dist/compiled/@next/font/dist/google/fetch-font-file.js:24:51)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7) {
  type: 'aborted'
}
error - Failed to download `Noto Sans JP` from Google Fonts. Using fallback font instead.

In my case, I have editted /Users/ReoHakase/repos/nitic-astronomy/node_modules/.pnpm/next@13.3.4_@babel+core@7.21.4_react-dom@18.2.0_react@18.2.0_sass@1.62.1/node_modules/next/dist/compiled/@next/font/dist/google/fetch-font-file.js as shown in the followind code:

    const controller = new AbortController();
    const timeoutId = setTimeout(() => controller.abort(), 30000); // Originally 3000
    const arrayBuffer = await (0, node_fetch_1.default)(url, {
        agent: (0, get_proxy_agent_1.getProxyAgent)(),
        // Add a timeout in dev
        signal: isDev ? controller.signal : undefined,
    })
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nitic-astronomy-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2023 4:59pm