Page not found after successful deployment

My site
https://keen-shirley-e5c522.netlify.app/

I have successfully deployed my site without any errors. But still I’m unable to view my site as it says “Page Not Found”.

I have already deployed many Angular based web applications and followed same steps for this one as well but somehow not working this time.

Sharing deploy logs below.

1:31:44 AM: Build ready to start
1:31:45 AM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
1:31:45 AM: build-image tag: v3.3.20
1:31:45 AM: buildbot version: be8ecf2af866e16fa4301cc5c14de2ccbbb21cf4
1:31:46 AM: Fetching cached dependencies
1:31:46 AM: Starting to download cache of 254.8KB
1:31:46 AM: Finished downloading cache in 91.262078ms
1:31:46 AM: Starting to extract cache
1:31:46 AM: Failed to fetch cache, continuing with build
1:31:46 AM: Starting to prepare the repo for build
1:31:46 AM: No cached dependencies found. Cloning fresh repo
1:31:46 AM: git clone https://github.com/saadsufyan/bmu
1:31:48 AM: Preparing Git Reference refs/heads/master
1:31:49 AM: Starting build script
1:31:49 AM: Installing dependencies
1:31:49 AM: Python version set to 2.7
1:31:50 AM: v12.18.0 is already installed.
1:31:51 AM: Now using node v12.18.0 (npm v6.14.4)
1:31:51 AM: Started restoring cached build plugins
1:31:51 AM: Finished restoring cached build plugins
1:31:51 AM: Attempting ruby version 2.7.1, read from environment
1:31:52 AM: Using ruby version 2.7.1
1:31:53 AM: Using PHP version 5.6
1:31:53 AM: 5.2 is already installed.
1:31:53 AM: Using Swift version 5.2
1:31:53 AM: Started restoring cached node modules
1:31:53 AM: Finished restoring cached node modules
1:31:53 AM: Installing NPM modules using NPM version 6.14.4
1:32:18 AM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
1:32:18 AM: > node -e “try{require(‘./postinstall’)}catch(e){}”
1:32:18 AM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/karma/node_modules/core-js
1:32:18 AM: > node -e “try{require(‘./postinstall’)}catch(e){}”
1:32:18 AM: > @angular/cli@8.0.6 postinstall /opt/build/repo/node_modules/@angular/cli
1:32:18 AM: > node ./bin/postinstall/script.js
1:32:19 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/watchpack/node_modules/fsevents):
1:32:19 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
1:32:19 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
1:32:19 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
1:32:19 AM: added 1062 packages from 1064 contributors and audited 1069 packages in 25.631s
1:32:20 AM: 24 packages are looking for funding
1:32:20 AM: run npm fund for details
1:32:20 AM: found 42 vulnerabilities (37 low, 3 moderate, 2 high)
1:32:20 AM: run npm audit fix to fix them, or npm audit for details
1:32:20 AM: NPM modules installed
1:32:20 AM: Started restoring cached go cache
1:32:20 AM: Finished restoring cached go cache
1:32:20 AM: go version go1.14.4 linux/amd64
1:32:20 AM: go version go1.14.4 linux/amd64
1:32:20 AM: Installing missing commands
1:32:20 AM: Verify run directory
1:32:22 AM: ​
1:32:22 AM: ┌─────────────────────────────┐
1:32:22 AM: │ Netlify Build │
1:32:22 AM: └─────────────────────────────┘
1:32:22 AM: ​
1:32:22 AM: ❯ Version
1:32:22 AM: @netlify/build 3.0.1
1:32:22 AM: ​
1:32:22 AM: ❯ Flags
1:32:22 AM: deployId: 5f1e66c0af0e2cfce0ed6c1f
1:32:22 AM: mode: buildbot
1:32:22 AM: ​
1:32:22 AM: ❯ Current directory
1:32:22 AM: /opt/build/repo
1:32:22 AM: ​
1:32:22 AM: ❯ Config file
1:32:22 AM: No config file was defined: using default values.
1:32:22 AM: ​
1:32:22 AM: ❯ Context
1:32:22 AM: production
1:32:22 AM: ​
1:32:22 AM: ┌───────────────────────────────────┐
1:32:22 AM: │ 1. Build command from Netlify app │
1:32:22 AM: └───────────────────────────────────┘
1:32:22 AM: ​
1:32:22 AM: $ ng build --prod=true
1:32:25 AM: Browserslist: caniuse-lite is outdated. Please run next command npm update
1:33:22 AM: Date: 2020-07-27T05:33:22.984Z
1:33:22 AM: Hash: 1da8093ae1e31ac6d8df
1:33:22 AM: Time: 57388ms
1:33:22 AM: chunk {0} runtime-es5.741402d1d47331ce975c.js (runtime) 1.41 kB [entry] [rendered]
1:33:22 AM: chunk {1} main-es5.e237893e1b0f28b69210.js (main) 669 kB [initial] [rendered]
1:33:22 AM: chunk {2} polyfills-es5.4e06eb653a3c8a2d581f.js (polyfills) 111 kB [initial] [rendered]
1:33:22 AM: chunk {scripts} scripts.ee52cf203ae78d4126af.js (scripts) 218 kB [entry] [rendered]
1:34:12 AM: Date: 2020-07-27T05:34:12.773Z
1:34:12 AM: Hash: 3ed3f49a39bd912c4bd5
1:34:12 AM: Time: 49696ms
1:34:12 AM: chunk {0} runtime-es2015.858f8dd898b75fe86926.js (runtime) 1.41 kB [entry] [rendered]
1:34:12 AM: chunk {1} main-es2015.ab8f42f9468c42888dd2.js (main) 606 kB [initial] [rendered]
1:34:12 AM: chunk {2} polyfills-es2015.5728f680576ca47e99fe.js (polyfills) 36.4 kB [initial] [rendered]
1:34:12 AM: chunk {3} styles.f907f8896ede22fc1a61.css (styles) 187 kB [initial] [rendered]
1:34:12 AM: chunk {scripts} scripts.ee52cf203ae78d4126af.js (scripts) 218 kB [entry] [rendered]
1:34:12 AM: ​
1:34:12 AM: (build.command completed in 1m 50.7s)
1:34:12 AM: ​
1:34:12 AM: ┌─────────────────────────────┐
1:34:12 AM: │ Netlify Build Complete │
1:34:12 AM: └─────────────────────────────┘
1:34:12 AM: ​
1:34:12 AM: (Netlify Build completed in 1m 50.7s)
1:34:12 AM: Caching artifacts
1:34:12 AM: Started saving node modules
1:34:12 AM: Finished saving node modules
1:34:12 AM: Started saving build plugins
1:34:12 AM: Finished saving build plugins
1:34:12 AM: Started saving pip cache
1:34:13 AM: Finished saving pip cache
1:34:13 AM: Started saving emacs cask dependencies
1:34:13 AM: Finished saving emacs cask dependencies
1:34:13 AM: Started saving maven dependencies
1:34:13 AM: Finished saving maven dependencies
1:34:13 AM: Started saving boot dependencies
1:34:13 AM: Finished saving boot dependencies
1:34:13 AM: Started saving go dependencies
1:34:13 AM: Finished saving go dependencies
1:34:16 AM: Build script success
1:34:16 AM: Starting to deploy site from ‘dist’
1:34:16 AM: Creating deploy tree
1:34:16 AM: Creating deploy upload records
1:34:16 AM: 0 new files to upload
1:34:16 AM: 0 new functions to upload
1:34:16 AM: Starting post processing
1:34:16 AM: Post processing - HTML
1:34:16 AM: Post processing - redirect rules
1:34:16 AM: Post processing - header rules
1:34:16 AM: Post processing done
1:34:16 AM: Site is live
1:34:45 AM: Finished processing build request in 2m59.740984095s

Hi, @saadsufyan, the index.hmtl is in a subdirectory and found here:

https://keen-shirley-e5c522.netlify.app/bmu-web/

This page many 404 references in it. For example, the URL below:

https://keen-shirley-e5c522.netlify.app/runtime-es2015.858f8dd898b75fe86926.js

Why is it a 404? Because the URL with that file is actually:

https://keen-shirley-e5c522.netlify.app/bmu-web/runtime-es2015.858f8dd898b75fe86926.js

I think you you change the publish directory to “dist/bmu-web” (without the quotes) here, that will resolve the issue.

If not or if there are other questions, please let us know.

1 Like

@luke thanks that resolve my issue, I’m not sure why it created a subdirectory on production build. Anyways thanks for your help !! Much appreciated.

1 Like