next.jsで作ったホームページをcloudflarePagesにホスティングしたい
Q&A
Closed
解決したいこと
ここに解決したい内容を記載してください。
next.jsで作ったホームページをcloudflareでホスティングしようとすると
buildのエラーが起きました、また実験的にnetlifyにもホスティングしてみたのですが
やはりエラーが出ました。
しかしVercelだとエラー起きなかったのですが個人店舗のホームページのため月額を安くしたい依頼でしたので、cloudflareでホスティングしたいと思っております
どうすればホスティングできるようになるのでしょうか。
ご教授ください
発生している問題・エラー
2023-12-14T23:45:19.602602Z Cloning repository...
2023-12-14T23:45:20.731268Z From https://github.com/yuuki2323/ankoromochi
2023-12-14T23:45:20.731988Z * branch bc2044b566af34b49c4693e02faf372efc2e5584 -> FETCH_HEAD
2023-12-14T23:45:20.732192Z
2023-12-14T23:45:20.803179Z HEAD is now at bc2044b 1
2023-12-14T23:45:20.803885Z
2023-12-14T23:45:20.916539Z
2023-12-14T23:45:20.949369Z Success: Finished cloning repository files
2023-12-14T23:45:21.767456Z Detected the following tools from environment: nodejs@16.20.2, npm@9.6.7
2023-12-14T23:45:21.768485Z Installing nodejs 16.20.2
2023-12-14T23:45:21.865478Z nodejs 16.20.2 is already installed
2023-12-14T23:45:22.543868Z Installing project dependencies: npm clean-install --progress=false
2023-12-14T23:45:24.401195Z npm WARN EBADENGINE Unsupported engine {
2023-12-14T23:45:24.401573Z npm WARN EBADENGINE package: 'next@14.0.3',
2023-12-14T23:45:24.401757Z npm WARN EBADENGINE required: { node: '>=18.17.0' },
2023-12-14T23:45:24.401908Z npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
2023-12-14T23:45:24.402085Z npm WARN EBADENGINE }
2023-12-14T23:45:28.206616Z npm WARN deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
2023-12-14T23:45:28.250649Z npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
2023-12-14T23:45:28.598454Z npm WARN deprecated uuid@3.3.2: 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.
2023-12-14T23:45:32.163238Z npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
2023-12-14T23:46:00.077281Z
2023-12-14T23:46:00.078108Z added 701 packages, and audited 703 packages in 36s
2023-12-14T23:46:00.078343Z
2023-12-14T23:46:00.078491Z 152 packages are looking for funding
2023-12-14T23:46:00.078664Z run `npm fund` for details
2023-12-14T23:46:00.090592Z
2023-12-14T23:46:00.090883Z 4 moderate severity vulnerabilities
2023-12-14T23:46:00.091066Z
2023-12-14T23:46:00.091252Z To address all issues, run:
2023-12-14T23:46:00.09141Z npm audit fix
2023-12-14T23:46:00.091563Z
2023-12-14T23:46:00.091703Z Run `npm audit` for details.
2023-12-14T23:46:00.115266Z Executing user command: npx next build
2023-12-14T23:46:01.738954Z unhandledRejection ReferenceError: Headers is not defined
2023-12-14T23:46:01.740893Z at Object.<anonymous> (/opt/buildhome/repo/node_modules/next/dist/server/web/spec-extension/adapters/headers.js:32:30)
2023-12-14T23:46:01.741165Z at Module._compile (node:internal/modules/cjs/loader:1198:14)
2023-12-14T23:46:01.741327Z at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
2023-12-14T23:46:01.741476Z at Module.load (node:internal/modules/cjs/loader:1076:32)
2023-12-14T23:46:01.741663Z at Function.Module._load (node:internal/modules/cjs/loader:911:12)
2023-12-14T23:46:01.741976Z at Module.require (node:internal/modules/cjs/loader:1100:19)
2023-12-14T23:46:01.742177Z at Module.mod.require (/opt/buildhome/repo/node_modules/next/dist/server/require-hook.js:64:28)
2023-12-14T23:46:01.742331Z at require (node:internal/modules/cjs/helpers:119:18)
2023-12-14T23:46:01.742466Z at Object.<anonymous> (/opt/buildhome/repo/node_modules/next/dist/server/api-utils/index.js:63:18)
2023-12-14T23:46:01.742683Z at Module._compile (node:internal/modules/cjs/loader:1198:14)
2023-12-14T23:46:01.756783Z Failed: Error while executing user command. Exited with error code: 1
2023-12-14T23:46:01.767738Z Failed: build command exited with code: 1
2023-12-14T23:46:02.871725Z Failed: error occurred while running build command
または、問題・エラーが起きている画像をここにドラッグアンドドロップ
該当するソースコード
next.jsとcloudflare