npm run build 在 React Hook 函数中给出错误

问题描述 投票:0回答:1

我正在使用nextjs 14

python-course/page.tsx

当我在我的项目上运行 npm run build 时,此页面给出错误

这是我的package.json

`` { “名称”:“前端”, “版本”:“0.1.0”, “私人”:真实, “脚本”:{ “dev”:“下一个开发者”, “构建”:“下一个构建”, "start": "下次开始", "lint": "下一个 lint" }, “浏览器”:{ “子进程”:“假” }, “依赖项”:{ "@clerk/nextjs": "^4.29.9", "@heroicons/react": "^1.0.6", "@stripe/stripe-js": "^3.2.0", "@tsarticles/engine": "^3.3.0", "@tsarticles/react": "^3.0.0", "@tsarticles/slim": "^3.3.0", "axios": "^1.6.7", "body-parser": "^1.20.2", "child_process": "^1.0.2", "子进程": "^1.0.2", "职员": "^0.8.3", "clsx": "^2.1.0", "dotenv": "^16.4.5", "express": "^4.19.2", “firebase”:“^10.0.0”,

"react-firebase-hooks": "^5.1.1",
"framer-motion": "^11.0.12",
"isomorphic-unfetch": "^3.0.0",
"mini-svg-data-uri": "^1.4.4",
"mongodb": "^6.5.0",
"mongoose": "^8.3.0",
"next": "14.0.4",
"raw-body": "^2.5.2",
"react": "^18",
"react-dom": "^18",
"react-icons": "^5.0.1",
"react-monaco-editor": "^0.55.0",
"react-resizable": "^3.0.5",
"react-split": "^2.0.14",
"sharp": "^0.33.2",
"stripe": "^14.23.0",
"swr": "1.1.2",
"tailwind-merge": "^2.2.1",
"unfetch": "^5.0.0"

}, “开发依赖项”:{ "@types/node": "^20", "@types/raw-body": "^2.3.0", “@types/react”:“^18”, "@types/react-dom": "^18", “自动前缀”:“^10.0.1”, “eslint”:“^8”, “eslint-config-next”:“14.1.0”, "postcss": "^8", "tailwindcss": "^3.3.0", “打字稿”:“^5” } }

``

我以前从未遇到过此类错误,并且无法从互联网上获得任何解决方案

reactjs node.js firebase next.js
1个回答
0
投票

将“页面函数名称”的第一个字符设为大写字母,例如“Page”。

React 组件名称必须以首字母大写开头。

现在你的问题解决了😊

提示:您应该在useEffect之外使用handleScroll函数并将其传递到[]内部。

© www.soinside.com 2019 - 2024. All rights reserved.