質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.47%
Netlify

Netlifyは、静的サイトを超高速でホスティングできる高機能なWebサービスです。WordPressといった動的処理を必要としないLPなどの静的Webサイトを公開することが可能。カスタムドメイン設定や無料SSL証明書などの多くの機能を無料で使用できます。

Gatsby

Gatsbyとは、Reactベースの静的サイトジェネレータ。最新のフロントエンド技術を活かし、機能豊富なWebサイトやアプリケーションを作ることが可能です。GraphQLを用いてあらゆるソースからサイトのデータを取得。指定した設定に基づいて静的サイトを構築することができます。

Q&A

0回答

1365閲覧

Gatsby.jsで作成したサイトがNetlifyへのデプロイに失敗する

takgria

総合スコア4

Netlify

Netlifyは、静的サイトを超高速でホスティングできる高機能なWebサービスです。WordPressといった動的処理を必要としないLPなどの静的Webサイトを公開することが可能。カスタムドメイン設定や無料SSL証明書などの多くの機能を無料で使用できます。

Gatsby

Gatsbyとは、Reactベースの静的サイトジェネレータ。最新のフロントエンド技術を活かし、機能豊富なWebサイトやアプリケーションを作ることが可能です。GraphQLを用いてあらゆるソースからサイトのデータを取得。指定した設定に基づいて静的サイトを構築することができます。

0グッド

0クリップ

投稿2021/08/28 09:12

編集2021/08/28 09:14

Gatsby.jsで作成した静的サイトのデプロイに失敗します。
npm run buildの段階でエラーとなっているようですが、原因が特定できません。

log

15:53:46 PM: Build ready to start 2 35:54:01 PM: npm WARN old lockfile 45:54:01 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm, 55:54:01 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry. 65:54:01 PM: npm WARN old lockfile 75:54:01 PM: npm WARN old lockfile This is a one-time fix-up, please be patient... 85:54:01 PM: npm WARN old lockfile 95:54:29 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated 105:54:29 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated 115:54:30 PM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. 125:54:32 PM: npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. 135:54:41 PM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained 145:54:41 PM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained 155:54:42 PM: npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address' 165:54:43 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. 175:54:44 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. 185:54:44 PM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained 195:54:46 PM: npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi' 205:55:12 PM: added 1729 packages, and audited 1730 packages in 1m 215:55:12 PM: 210 packages are looking for funding 225:55:12 PM: run `npm fund` for details 235:55:12 PM: 18 vulnerabilities (13 moderate, 5 high) 245:55:12 PM: To address issues that do not require attention, run: 255:55:12 PM: npm audit fix 265:55:12 PM: To address all issues (including breaking changes), run: 275:55:12 PM: npm audit fix --force 285:55:12 PM: Run `npm audit` for details. 295:55:12 PM: NPM modules installed 305:55:12 PM: Started restoring cached go cache 315:55:12 PM: Finished restoring cached go cache 325:55:12 PM: go version go1.16.5 linux/amd64 335:55:12 PM: go version go1.16.5 linux/amd64 345:55:12 PM: Installing missing commands 355:55:12 PM: Verify run directory 365:55:14 PM: ​ 375:55:14 PM: ──────────────────────────────────────────────────────────────── 385:55:14 PM: Netlify Build 395:55:14 PM: ──────────────────────────────────────────────────────────────── 405:55:14 PM: ​ 415:55:14 PM: ❯ Version 425:55:14 PM: @netlify/build 18.7.2 435:55:14 PM: ​ 445:55:14 PM: ❯ Flags 455:55:14 PM: baseRelDir: true 465:55:14 PM: buildId: 6129f99a14147c06942db803 475:55:14 PM: deployId: 6129f99a14147c06942db805 485:55:14 PM: ​ 495:55:14 PM: ❯ Current directory 505:55:14 PM: /opt/build/repo 515:55:14 PM: ​ 525:55:14 PM: ❯ Config file 535:55:14 PM: No config file was defined: using default values. 545:55:14 PM: ​ 555:55:14 PM: ❯ Context 565:55:14 PM: production 575:55:14 PM: ​ 585:55:14 PM: ❯ Installing plugins 595:55:14 PM: - @netlify/plugin-gatsby@1.0.3 605:55:19 PM: ​ 615:55:19 PM: ❯ Loading plugins 625:55:19 PM: - @netlify/plugin-gatsby@1.0.3 from Netlify app 635:55:19 PM: ​ 645:55:19 PM: ──────────────────────────────────────────────────────────────── 655:55:19 PM: 1. onPreBuild command from @netlify/plugin-gatsby 665:55:19 PM: ──────────────────────────────────────────────────────────────── 675:55:19 PM: ​ 685:55:19 PM: No Gatsby cache found. Building fresh. 695:55:19 PM: Add `gatsby-plugin-netlify` to `gatsby-config.js` if you would like to support Gatsby redirects. ???? 705:55:19 PM: ​ 715:55:19 PM: (@netlify/plugin-gatsby onPreBuild completed in 181ms) 725:55:19 PM: ​ 735:55:19 PM: ──────────────────────────────────────────────────────────────── 745:55:19 PM: 2. Build command from Netlify app 755:55:19 PM: ──────────────────────────────────────────────────────────────── 765:55:19 PM: ​ 775:55:20 PM: $ npm run build 785:55:20 PM: > gatsby-starter-hello-world@0.1.0 build 795:55:20 PM: > gatsby build 805:55:23 PM: success open and validate gatsby-configs, load plugins - 0.106s 815:55:23 PM: success onPreInit - 0.031s 825:55:23 PM: success initialize cache - 0.014s 835:55:23 PM: success copy gatsby files - 0.080s 845:55:23 PM: success Compiling Gatsby Functions - 0.355s 855:55:23 PM: success onPreBootstrap - 0.374s 865:55:23 PM: success createSchemaCustomization - 0.001s 875:55:23 PM: success Checking for changed pages - 0.000s 885:55:23 PM: success source and transform nodes - 0.036s 895:55:24 PM: success building schema - 1.094s 905:55:24 PM: success createPages - 0.000s 915:55:25 PM: success createPagesStatefully - 0.177s 925:55:25 PM: info Total nodes: 23, SitePage nodes: 2 (use --verbose for breakdown) 935:55:25 PM: success Checking for changed pages - 0.000s 945:55:25 PM: success update schema - 0.218s 955:55:25 PM: success onPreExtractQueries - 0.000s 965:55:25 PM: success extract queries from components - 0.103s 975:55:25 PM: success write out redirect data - 0.001s 985:55:25 PM: success onPostBootstrap - 0.000s 995:55:25 PM: info bootstrap finished - 4.994s 1005:55:25 PM: success run page queries - 0.061s - 2/2 33.03/s 1015:55:25 PM: success write out requires - 0.007s 1025:55:40 PM: success Building production JavaScript and CSS bundles - 15.109s 1035:55:40 PM: success Rewriting compilation hashes - 0.008s 1045:55:40 PM: success Writing page-data.json files to public directory - 0.007s - 2/2 298.46/s 1055:55:42 PM: success Building HTML renderer - 1.438s 1065:55:42 PM: error Page data from page-data.json for the failed page "/Top/": { 1075:55:42 PM: "componentChunkName": "component---src-pages-top-js", 1085:55:42 PM: "path": "/Top/", 1095:55:42 PM: "result": { 1105:55:42 PM: "pageContext": {} 1115:55:42 PM: }, 1125:55:42 PM: "staticQueryHashes": [] 1135:55:42 PM: } 1145:55:42 PM: failed Building static HTML for pages - 0.582s 1155:55:42 PM: error Building static HTML failed for path "/Top/" 1165:55:42 PM: 1175:55:42 PM: 15 | 1185:55:42 PM: 16 | module.exports["default"] = module.exports, module.exports.__esModule = true; 1195:55:42 PM: > 17 | return _extends.apply(this, arguments); 1205:55:42 PM: | ^ 1215:55:42 PM: 18 | } 1225:55:42 PM: 19 | 1235:55:42 PM: 20 | module.exports = _extends; 1245:55:42 PM: 1255:55:42 PM: WebpackError: Minified React error #130; visit https://reactjs.org/docs/error- decoder.html?invariant=130&args[]=object&args[]= for the full message or use t he non-minified dev environment for full errors and additional helpful warning s. 1265:55:42 PM: 1275:55:42 PM: - extends.js:17 1285:55:42 PM: [gatsby-starter-hello-world]/[@babel]/runtime/helpers/extends.js:17:1 1295:55:42 PM: 1305:55:42 PM: - extends.js:13 1315:55:42 PM: [gatsby-starter-hello-world]/[@babel]/runtime/helpers/extends.js:13:1 1325:55:42 PM: 1335:55:42 PM: - static-entry.js:286 1345:55:42 PM: gatsby-starter-hello-world/.cache/static-entry.js:286:22 1355:55:42 PM: 1365:55:42 PM: - emotion-cache.esm.js:175 1375:55:42 PM: [gatsby-starter-hello-world]/[@emotion]/cache/dist/emotion-cache.esm.js:175: 1 1385:55:42 PM: 1395:55:42 PM: 1405:55:42 PM: not finished Caching JavaScript and CSS webpack compilation - 2.087s 1415:55:42 PM: not finished Caching HTML renderer compilation - 0.625s 1425:55:43 PM: ​ 1435:55:43 PM: ──────────────────────────────────────────────────────────────── 1445:55:43 PM: "build.command" failed 1455:55:43 PM: ──────────────────────────────────────────────────────────────── 1465:55:43 PM: ​ 1475:55:43 PM: Error message 1485:55:43 PM: Command failed with exit code 1: npm run build 1495:55:43 PM: ​ 1505:55:43 PM: Error location 1515:55:43 PM: In Build command from Netlify app: 1525:55:43 PM: npm run build 1535:55:43 PM: ​ 1545:55:43 PM: Resolved config 1555:55:43 PM: build: 1565:55:43 PM: command: npm run build 1575:55:43 PM: commandOrigin: ui 1585:55:43 PM: publish: /opt/build/repo/public 1595:55:43 PM: publishOrigin: ui 1605:55:43 PM: plugins: 1615:55:43 PM: - inputs: {} 1625:55:43 PM: origin: ui 1635:55:43 PM: package: '@netlify/plugin-gatsby' 1645:55:43 PM: Caching artifacts 1655:55:43 PM: Started saving node modules 1665:55:43 PM: Finished saving node modules 1675:55:43 PM: Started saving build plugins 1685:55:43 PM: Finished saving build plugins 1695:55:43 PM: Started saving pip cache 1705:55:43 PM: Finished saving pip cache 1715:55:43 PM: Started saving emacs cask dependencies 1725:55:43 PM: Finished saving emacs cask dependencies 1735:55:43 PM: Started saving maven dependencies 1745:55:43 PM: Finished saving maven dependencies 1755:55:43 PM: Started saving boot dependencies 1765:55:43 PM: Finished saving boot dependencies 1775:55:43 PM: Started saving rust rustup cache 1785:55:43 PM: Finished saving rust rustup cache 1795:55:43 PM: Started saving go dependencies 1805:55:43 PM: Finished saving go dependencies 1815:55:46 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 1825:55:46 PM: Creating deploy upload records 1835:55:46 PM: Failing build: Failed to build site 1845:55:46 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 1855:55:46 PM: Finished processing build request in 1m57.901746667s

ライブラリはreact-intersection-observerやEmotionを入れていますが、何か関係あるのでしょうか?
nodeのバージョンはv14.15.1ですが、試しに作成した別のサイトではデプロイに成功しているので、処理になんらかの不備があるのではと思っています。
エラーログを見ても原因が分からないので、どなたかアドバイス頂けますと幸いです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.47%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問