我正在嘗試使用以下命令從我的 VSCode 命令列在 vercel 上部署一個網站:
vercel
當我執行這個命令時,我得到這個輸出:

如果我運行:
vercel logs demo-minting-frontend-rga7f9q73-hemang-h.vercel.app
我得到如下輸出:
PS C:\CS\Three.js\Marketplace-three\Self-coded-creation> vercel logs demo-minting-frontend-rga7f9q73-hemang-h.vercel.app
Vercel CLI 24.0.0
> Fetched deployment "demo-minting-frontend-rga7f9q73-hemang-h.vercel.app" in hemang-h [1s]
2022-03-07T15:36:56.106Z
2022-03-07T15:36:56.112Z Retrieving list of deployment files...
2022-03-07T15:36:57.506Z Downloading 49 deployment files...
2022-03-07T15:36:58.268Z Analyzing source code...
2022-03-07T15:36:58.657Z Installing build runtime...
2022-03-07T15:37:01.398Z Build runtime installed: 2.741s
2022-03-07T15:37:02.062Z Looking up build cache...
2022-03-07T15:37:05.865Z Build cache downloaded [87.05 MB]: 3377.740ms
2022-03-07T15:37:06.003Z Detected package.json
2022-03-07T15:37:06.004Z Installing dependencies...
2022-03-07T15:37:06.011Z Detected `package-lock.json` generated by npm 7...
2022-03-07T15:37:07.781Z 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.
2022-03-07T15:37:08.047Z
2022-03-07T15:37:08.048Z added 1 package, and changed 1 package in 2s
2022-03-07T15:37:08.048Z
2022-03-07T15:37:08.048Z 116 packages are looking for funding
2022-03-07T15:37:08.048Z run `npm fund` for details
2022-03-07T15:37:08.257Z Detected `package-lock.json` generated by npm 7...
2022-03-07T15:37:08.257Z Running "npm run build"
2022-03-07T15:37:08.537Z
2022-03-07T15:37:08.537Z > demo-minting-page@1.0.0 build
2022-03-07T15:37:08.537Z > next build
2022-03-07T15:37:08.537Z
2022-03-07T15:37:09.158Z warn - SWC minify release candidate enabled. https://nextjs.org/docs/messages/swc-minify-enabled
2022-03-07T15:37:09.177Z Attention: Next.js now collects completely anonymous telemetry regarding usage.
2022-03-07T15:37:09.177Z This information is used to shape Next.js' roadmap and prioritize features.
2022-03-07T15:37:09.177Z You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following
URL:
2022-03-07T15:37:09.177Z https://nextjs.org/telemetry
2022-03-07T15:37:09.177Z
2022-03-07T15:37:09.218Z info - Checking validity of types...
2022-03-07T15:37:11.594Z
2022-03-07T15:37:11.594Z Failed to compile.
2022-03-07T15:37:11.595Z
2022-03-07T15:37:11.595Z ./pages/404.js
2022-03-07T15:37:11.595Z 18:9 Warning: passHref is missing. See: https://nextjs.org/docs/messages/link-passhref @next/next/link-passhref
2022-03-07T15:37:11.595Z
2022-03-07T15:37:11.595Z ./pages/Landing.js
2022-03-07T15:37:11.595Z 6:10 Error: 'Text' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.595Z 6:16 Error: 'Flex' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.595Z 7:10 Error: 'useState' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.596Z 13:5 Error: 'success' is assigned a value but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.596Z 15:5 Error: 'owned' is assigned a value but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.596Z 16:5 Error: 'owner' is assigned a value but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.596Z 26:5 Error: 'reset' is assigned a value but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.596Z
2022-03-07T15:37:11.596Z ./pages/index.js
2022-03-07T15:37:11.596Z 92:11 Warning: passHref is missing. See: https://nextjs.org/docs/messages/link-passhref @next/next/link-passhref
2022-03-07T15:37:11.596Z 182:11 Warning: passHref is missing. See: https://nextjs.org/docs/messages/link-passhref @next/next/link-passhref
2022-03-07T15:37:11.596Z
2022-03-07T15:37:11.596Z ./pages/mint.js
2022-03-07T15:37:11.597Z 1:30 Error: 'SimpleGrid' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.597Z 1:42 Error: 'Divider' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.597Z 3:8 Error: 'Section' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.597Z 4:10 Error: 'WorkGridItem' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.598Z 11:28 Error: React Hook "useWeb3Modal" is called in function "mint" that is neither a React function component nor a custom React
Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use". react-hooks/rules-of-hooks
2022-03-07T15:37:11.598Z
2022-03-07T15:37:11.598Z ./components/grid-item.js
2022-03-07T15:37:11.598Z 26:5 Warning: passHref is missing. See: https://nextjs.org/docs/messages/link-passhref @next/next/link-passhref
2022-03-07T15:37:11.598Z
2022-03-07T15:37:11.598Z ./components/mint.js
2022-03-07T15:37:11.598Z 3:30 Error: 'VStack' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.598Z 3:52 Error: 'Link' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.598Z 3:58 Error: 'Text' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.599Z 3:64 Error: 'Spacer' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.599Z 5:33 Error: 'IoMdOpen' is defined but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.599Z 8:41 Error: 'loading' is assigned a value but never used. Allowed unused vars must match /^_/u. no-unused-vars
2022-03-07T15:37:11.599Z
2022-03-07T15:37:11.599Z info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
2022-03-07T15:37:11.616Z Error: Command "npm run build" exited with 1
2022-03-07T15:37:12.463Z
現在,只是說我嘗試解決警告,我運行:
npm install uuid
安裝最新的 uuid 版本,這樣我就可以繞過第一個警告。但它也沒有幫助。我再次執行vercel命令,并且有類似的日志。
我試圖CI=False在專案設定下將構建設定覆寫到 Vercel 上,但仍然沒有得到任何成功的回應。
我的 package.json 看起來像這樣:
{
"name": "demo-minting-page",
"version": "1.0.0",
"description": "TokenMinds Demo ",
"scripts": {
"dev": "next dev -H 0.0.0.0",
"prettier": "prettier -write .",
"lint": "next lint",
"build": "next build",
"start": "next start"
},
"keywords": [],
"author": "Hemang Joshi",
"license": "MIT",
"dependencies": {
"@chakra-ui/icons": "^1.1.7",
"@chakra-ui/react": "^1.8.6",
"@emotion/react": "^11.8.1",
"@emotion/styled": "^11.8.1",
"ethers": "^5.5.4",
"framer-motion": "^6.2.8",
"merkletreejs": "^0.2.30",
"react-icons": "^4.3.1",
"react-toastify": "^8.2.0",
"three": "^0.138.3",
"uuid": "^8.3.2",
"web3": "^1.7.1",
"web3modal": "^1.9.5",
"zustand": "^3.7.1"
},
"devDependencies": {
"eslint": "^8.9.0",
"eslint-config-next": "^12.1.0",
"prettier": "^2.5.1",
"webpack": "^5.70.0"
}
}
.eslintrc.json 看起來像這樣:
{
"root": true,
"extends": "next",
"rules": {
"plugin":[
"react/recommended"
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"react/display-name": 0
}
}
鏈接到我保存此代碼的完整 github 存盤庫是: Github repo
請幫幫我,我該怎么辦。
PS:- 在我的 localhost:3000 上一切都運行得非常順利,并且沒有錯誤。我現在已經在我的終端上運行了npm run dev幾次,但是本地主機上沒有任何投訴。
uj5u.com熱心網友回復:
有 2 種方法可以解決此問題。
- 似乎您正在將模塊匯入某些 js 檔案但沒有使用它們,因此請避免使用不必要的匯入,并且僅在頁面上使用模塊時才匯入模塊。如果您不使用它,請避免將該模塊匯入 js 檔案。
安裝以下模塊
npm install --save-dev eslint-plugin-react.(適用于使用 NPM 的開發人員)或yarn add --dev eslint-plugin-react.(適用于使用 Yarn 的開發人員)然后,在您
.eslintrc.json的擴展下,包含以下插件:'extends': [ 'plugin:react/recommended' ]
希望如果您使用這些建議中的任何一個,您的錯誤將得到解決
uj5u.com熱心網友回復:
這里的問題是從未使用過匯入的變數。請洗掉那些未使用的變數,然后npm run build在本地計算機上運行以查看是否遺漏了任何錯誤。之后,您可以重新部署到 vercel。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/442293.html
標籤:javascript npm 部署 建造 韦尔塞尔
