I've created my vercel app before, but when I tried to update with vercel --prod
, I got
Error! Command "yarn run build" exited with 1
Error! Check your logs...
When I check my logs I got it, but I do not understand what to do with them because I had others empty vars, for example, but it was not a problem.
16:02:07.366 Retrieving list of deployment files...
16:02:08.837 Downloading 25 deployment files...
16:02:09.301 Analyzing source code...
16:02:10.840 Installing build runtime...
16:02:13.806 Build runtime installed: 2.965s
16:02:17.056 Looking up build cache...
16:02:19.686 Build cache downloaded [24.72 MB]: 2226.563ms
16:02:20.981 Detected package.json
16:02:20.982 Installing dependencies...
16:02:21.305 yarn install v1.22.17
16:02:21.420 [1/4] Resolving packages...
16:02:22.236 success Already up-to-date.
16:02:22.241 Done in 0.94s.
16:02:22.515 Running "yarn run build"
16:02:22.752 yarn run v1.22.17
16:02:22.793 $ react-scripts build
16:02:24.503 Creating an optimized production build...
16:02:25.419 Browserslist: caniuse-lite is outdated. Please run:
16:02:25.419 npx browserslist@latest --update-db
16:02:25.420
16:02:25.420 Why you should do it regularly:
16:02:25.420 https://github.com/browserslist/browserslist#browsers-data-updating
16:02:29.686
16:02:29.686 Treating warnings as errors because process.env.CI = true.
16:02:29.687 Most CI servers set it automatically.
16:02:29.687
16:02:29.687 Failed to compile.
16:02:29.687
16:02:29.688 src/App.js
16:02:29.688 Line 7:20: 'setProducts' is assigned a value but never used no-unused-vars
16:02:29.688
16:02:29.688 src/components/CartProduct/index.jsx
16:02:29.688 Line 7:17: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
16:02:29.688
16:02:29.689 src/components/Product/index.jsx
16:02:29.691 Line 7:13: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
16:02:29.691
16:02:29.691
16:02:29.714 error Command failed with exit code 1.
16:02:29.714 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
16:02:29.732 Error: Command "yarn run build" exited with 1
In your eslint config file, turn off no-unused-var
"rules": {
.....
"no-unused-vars": "off"
.....
}
and add Alt for your images tags with or without text:
<img src="[image url]" alt="" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.