[SOLVED] Why am I stucking when deploy a React app to Netlify? – Stack Overflow

Issue

This Content is from Stack Overflow. Question asked by Wonster

I’m using Netlify to deploy a React app. But it stuck when deploying and shows few warnings which doesn’t matter locally.

And I tried to use CI= npm run build command as well, it did successfully deployed but the page was not found, which shows “Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site.”

Why would this happen? and How could I solve this?

10:13:44 AM: Verify run directory
10:13:45 AM: ​
10:13:45 AM: ────────────────────────────────────────────────────────────────
10:13:45 AM:   Netlify Build                                                 
10:13:45 AM: ────────────────────────────────────────────────────────────────
10:13:45 AM: ​
10:13:45 AM: ❯ Version
10:13:45 AM:   @netlify/build 27.18.1
10:13:45 AM: ​
10:13:45 AM: ❯ Flags
10:13:45 AM:   baseRelDir: true
10:13:45 AM:   buildId: 6327b4129c51cc1f43f77437
10:13:45 AM:   deployId: 6327b4129c51cc1f43f77439
10:13:45 AM: ​
10:13:45 AM: ❯ Current directory
10:13:45 AM:   /opt/build/repo/Final/dev
10:13:45 AM: ​
10:13:45 AM: ❯ Config file
10:13:45 AM:   No config file was defined: using default values.
10:13:45 AM: ​
10:13:45 AM: ❯ Context
10:13:45 AM:   production
10:13:45 AM: ​
10:13:45 AM: ────────────────────────────────────────────────────────────────
10:13:45 AM:   1. Build command from Netlify app                             
10:13:45 AM: ────────────────────────────────────────────────────────────────
10:13:45 AM: ​
10:13:45 AM: $ npm start
10:13:45 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
10:13:45 AM: npm WARN config location in the cache, and they are managed by
10:13:45 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
10:13:45 AM: > dev@0.1.0 start
10:13:45 AM: > react-scripts start
10:13:46 AM: (node:1533) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
10:13:46 AM: (Use `node --trace-deprecation ...` to show where the warning was created)
10:13:46 AM: (node:1533) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
10:13:47 AM: Starting the development server...
10:13:47 AM: 
10:14:08 AM: Compiled with warnings.
10:14:08 AM: 
10:14:08 AM: [eslint]
10:14:08 AM: src/Homepage.jsx
10:14:08 AM:   Line 4:17:  'useState' is defined but never used  no-unused-vars
10:14:08 AM: src/Settings.jsx
10:14:08 AM:   Line 139:11:  'uploadAvatar2fb' is assigned a value but never used  no-unused-vars
10:14:08 AM: src/Signup.jsx
10:14:08 AM:   Line 66:21:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
10:14:08 AM: src/utils/firebase.js
10:14:08 AM:   Line 6:45:  'addDoc' is defined but never used  no-unused-vars
10:14:08 AM: Search for the keywords to learn more about each warning.
10:14:08 AM: To ignore, add // eslint-disable-next-line to the line before.
10:14:08 AM: WARNING in [eslint]
10:14:08 AM: src/Homepage.jsx
10:14:08 AM:   Line 4:17:  'useState' is defined but never used  no-unused-vars
10:14:08 AM: src/Settings.jsx
10:14:08 AM:   Line 139:11:  'uploadAvatar2fb' is assigned a value but never used  no-unused-vars
10:14:08 AM: src/Signup.jsx
10:14:08 AM:   Line 66:21:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
10:14:08 AM: src/utils/firebase.js
10:14:08 AM:   Line 6:45:  'addDoc' is defined but never used  no-unused-vars
10:14:08 AM: webpack compiled with 1 warning



Solution

Make sure your repository contains the netlify.toml config file (or any config file) directly. For me it was in nested folder, if it’s the same in your case, add this folder in your Build settings in netlify as Base directory.
Screenshot here


This Question was asked in StackOverflow by Wonster and Answered by agnieszkaw61 It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?