Need lots of help

https://www.stephen-havenharris.com/

Hello there! I am new to this so any help would be appreciated!

First, I registered my domain with Google and keep getting " 404. That’s an error.
The requested URL was not found on this server. That’s all we know." Am I doing something wrong?

Also, as seen above my website works fine on VS Cose, but when I try to deploy it I get this:
7:44:24 PM: $ npm start

7:44:24 PM: > react-portfolio@0.1.0 start

7:44:24 PM: > react-scripts start

7:44:26 PM: (node:1410) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: ‘onAfterSetupMiddleware’ option is deprecated. Please use the ‘setupMiddlewares’ option.

7:44:26 PM: (Use node --trace-deprecation ... to show where the warning was created)

7:44:26 PM: (node:1410) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: ‘onBeforeSetupMiddleware’ option is deprecated. Please use the ‘setupMiddlewares’ option.

7:44:26 PM: Starting the development server…

7:44:26 PM:

7:44:31 PM: Failed to compile.

7:44:31 PM:

7:44:31 PM: Module not found: Error: Can’t resolve ‘C:/Users/Owner/Desktop/New folder/Portfolio/src/images/Stephen-Haven Harris (2).jpg’ in ‘/opt/build/repo/src/Components’
WARNING in [eslint]

7:44:31 PM: src/Components/Contact.js

7:44:31 PM: 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: eslint-plugin-jsx-a11y/anchor-is-valid.md at 93f78856655696a55309440593e0948c6fb96134 · jsx-eslint/eslint-plugin-jsx-a11y · GitHub jsx-a11y/anchor-is-valid

7:44:31 PM: src/Components/Navbar.js

7:44:31 PM: 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: eslint-plugin-jsx-a11y/anchor-is-valid.md at 93f78856655696a55309440593e0948c6fb96134 · jsx-eslint/eslint-plugin-jsx-a11y · GitHub jsx-a11y/anchor-is-valid

7:44:31 PM: ERROR in ./src/Components/About.js 5:0-103

7:44:31 PM: Module not found: Error: Can’t resolve ‘C:/Users/Owner/Desktop/New folder/Portfolio/src/images/Stephen-Haven Harris (2).jpg’ in ‘/opt/build/repo/src/Components’

7:44:31 PM: ERROR in ./src/Components/Projects.js 6:0-92

7:44:31 PM: Module not found: Error: Can’t resolve ‘C:/Users/Owner/Desktop/New folder/Portfolio/src/data.js’ in ‘/opt/build/repo/src/Components’

7:44:31 PM: ERROR in ./src/Components/Projects.js 7:0-98

7:44:31 PM: Module not found: Error: Can’t resolve ‘C:/Users/Owner/Desktop/New folder/Portfolio/src/images/Vending Application.png’ in ‘/opt/build/repo/src/Components’

7:44:31 PM: ERROR in ./src/Components/Projects.js 8:0-96

7:44:31 PM: Module not found: Error: Can’t resolve ‘C:/Users/Owner/Desktop/New folder/Portfolio/src/images/TEnmo Application.png’ in ‘/opt/build/repo/src/Components’

7:44:31 PM: webpack compiled with 4 errors and 1 warning

stephen-havenharris.com is currently using the default Google nameservers. Information about configuring a domain is available in the documentation and these helpful support guides

The error below is possibly due to an incorrectly named import possibly due to case sensitivity

And this error

suggests there is an anchor <a> somewhere without a href="" attribute.

1 Like

Thank you so much for answering!! I will read the documentation and see if I can fix this

So i was able to fix Data.Js but I can’t fix the last three:

8:32:16 PM: $ npm start

8:32:17 PM: > react-portfolio@0.1.0 start

8:32:17 PM: > react-scripts start

8:32:18 PM: (node:4094) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: ‘onAfterSetupMiddleware’ option is deprecated. Please use the ‘setupMiddlewares’ option.

8:32:18 PM: (Use node --trace-deprecation ... to show where the warning was created)

8:32:18 PM: (node:4094) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: ‘onBeforeSetupMiddleware’ option is deprecated. Please use the ‘setupMiddlewares’ option.

8:32:18 PM: Starting the development server…

8:32:18 PM:

8:32:23 PM: Failed to compile.

8:32:23 PM:

8:32:23 PM: Module not found: Error: Can’t resolve ‘…/ProfilePic.jpg’ in ‘/opt/build/repo/src/Components’
WARNING in [eslint]

8:32:23 PM: src/Components/Contact.js

8:32:23 PM: 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: eslint-plugin-jsx-a11y/anchor-is-valid.md at 93f78856655696a55309440593e0948c6fb96134 · jsx-eslint/eslint-plugin-jsx-a11y · GitHub jsx-a11y/anchor-is-valid

8:32:23 PM: src/Components/Navbar.js

8:32:23 PM: 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: eslint-plugin-jsx-a11y/anchor-is-valid.md at 93f78856655696a55309440593e0948c6fb96134 · jsx-eslint/eslint-plugin-jsx-a11y · GitHub jsx-a11y/anchor-is-valid

8:32:23 PM: ERROR in ./src/Components/About.js 5:0-37

8:32:23 PM: Module not found: Error: Can’t resolve ‘…/ProfilePic.jpg’ in ‘/opt/build/repo/src/Components’

8:32:23 PM: ERROR in ./src/Components/Projects.js 7:0-45

8:32:23 PM: Module not found: Error: Can’t resolve ‘…/VendingApplication.png’ in ‘/opt/build/repo/src/Components’

8:32:23 PM: ERROR in ./src/Components/Projects.js 8:0-43

8:32:23 PM: Module not found: Error: Can’t resolve ‘…/TEnmoApplication.png’ in ‘/opt/build/repo/src/Components’

8:32:23 PM: webpack compiled with 3 errors and 1 warning

I tried lowercase and uppercase but I still get these errors.

Can you share the repository you are deploying from?

1 Like

Here you go!

In src/Components/Projects.js there are two import statements that won’t work because the Netlify build system runs on Linux, not Windows

import img2 from "C:/Users/Owner/Desktop/Port/Portfolio/src/Images/VendingApplication.png"
import img3 from "C:/Users/Owner/Desktop/Port/Portfolio/src/Images/TEnmoApplication.png"

Instead try using

import img2 from "../Images/VendingApplication.png"
import img3 from "../Images/TEnmoApplication.png"

Same goes for src/Components/About.js.

1 Like

Thank you so much! It says it was published, but I am still getting the “page not found error” even though my custom domains have check marks and my site is HTTP enabled any advice?

Here is the DNS for my Google Domain if that helps!


What are the build settings you have used? What is the publish directory set to?

This is not a DNS issue.

Oh, I have it set to “src”, should I change it?

As noted in the Create React App Getting Started documentation npm run build

Builds the app for production to the build folder.

This is also mentioned in the Netlify Create React App documentation, as well as the Create React App Deploy to Netlify documentation.

So yes, you need to change the publish directory to build.

1 Like