I am new to frontend. I created a react app and pushed to git hub. when i try to deploy the app using Netifly, it throws error during building. Here is the log, i couldn’t find what is the error preventing from building.
10:55:49 AM: Netlify Build
10:55:49 AM: ────────────────────────────────────────────────────────────────
10:55:49 AM:
10:55:49 AM: ❯ Version
10:55:49 AM: @netlify/build 29.45.0
10:55:49 AM:
10:55:49 AM: ❯ Flags
10:55:49 AM: baseRelDir: true
10:55:49 AM: buildId: 665dd92f37be01007b3152a8
10:55:49 AM: deployId: 665dd92f37be01007b3152aa
10:55:49 AM:
10:55:49 AM: ❯ Current directory
10:55:49 AM: /opt/build/repo
10:55:49 AM:
10:55:49 AM: ❯ Config file
10:55:49 AM: No config file was defined: using default values.
10:55:49 AM:
10:55:49 AM: ❯ Context
10:55:49 AM: production
10:55:49 AM:
10:55:49 AM: Build command from Netlify app
10:55:49 AM: ────────────────────────────────────────────────────────────────
10:55:49 AM:
10:55:49 AM: $ npm run build
10:55:49 AM: > [email protected] build
10:55:49 AM: > react-scripts build
10:55:50 AM: Creating an optimized production build…
10:55:53 AM: One of your dependencies, babel-preset-react-app, is importing the
10:55:53 AM: “@babel/plugin-proposal-private-property-in-object” package without
10:55:53 AM: declaring it in its dependencies. This is currently working because
10:55:53 AM: “@babel/plugin-proposal-private-property-in-object” is already in your
10:55:53 AM: node_modules folder for unrelated reasons, but it may break at any time.
10:55:53 AM: babel-preset-react-app is part of the create-react-app project, which
10:55:53 AM: is not maintianed anymore. It is thus unlikely that this bug will
10:55:53 AM: ever be fixed. Add “@babel/plugin-proposal-private-property-in-object” to
10:55:53 AM: your devDependencies to work around this error. This will make this message
10:55:53 AM: go away.
10:55:53 AM: [BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/src/hero.svg as it exceeds the max of 500KB.
10:55:59 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
10:55:55 AM: [BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB.
10:55:58 AM:
10:55:58 AM: Treating warnings as errors because process.env.CI = true.
10:55:58 AM: Most CI servers set it automatically.
10:55:58 AM:
10:55:58 AM: Failed to compile.
10:55:58 AM:
10:55:58 AM: [eslint]
10:55:58 AM: src/components/Contact.js
10:55:58 AM: Line 57:15: The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid
10:55:58 AM: src/components/Navbar.js
10:55:58 AM: Line 8:9: The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid
10:55:58 AM:
10:55:58 AM: “build.command” failed
10:55:58 AM: ────────────────────────────────────────────────────────────────
10:55:58 AM:
10:55:58 AM: Error message
10:55:58 AM: Command failed with exit code 1: npm run build
10:55:58 AM:
10:55:58 AM: Error location
10:55:58 AM: In Build command from Netlify app:
10:55:58 AM: npm run build
10:55:58 AM:
10:55:58 AM: Resolved config
10:55:58 AM: build:
10:55:58 AM: command: npm run build
10:55:58 AM: commandOrigin: ui
10:55:58 AM: publish: /opt/build/repo/build
10:55:58 AM: publishOrigin: ui
10:55:59 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:55:59 AM: Failing build: Failed to build site
10:55:59 AM: Finished processing build request in 36.522s
I checked locally by running npm build, I could see warnings but no errors.