Local Build is working but Netlify Site gives chunk errors

Domain: ServiceLearn - 3D Staff Learning App, Powered by Gamification
GitHub: GitHub - spikethea/cctp-project: 3D WebApp for Comprehensive Creative Technologies Project using react-three-fiber

Hi, my project works locally, but when I try to build my website through netlify, it gives a chunk.js + unexpected token error when I click the ‘enter training’ button on my app (it still seems to work though). Ive built this project directly from GitHub, and it used to work fine, but all of a sudden it gives this error.

And the problem is that if you refresh the page once youve clicked inside the routes, like at say
servicelearn/training/homepage
the page doesnt load. I assumed It may be something to do with my redirects file but it seems fine. a
Thank you

Build Log:

9:00:57 PM: Build ready to start
9:00:59 PM: build-image version: 3571f0130496395a23bffe9820bc78b4f73a6234
9:00:59 PM: build-image tag: v3.7.0
9:00:59 PM: buildbot version: 1d9a65d1462a996a4489967112d0532ab577cee9
9:00:59 PM: Building without cache
9:00:59 PM: Starting to prepare the repo for build
9:01:00 PM: No cached dependencies found. Cloning fresh repo
9:01:00 PM: git clone GitHub - spikethea/cctp-project: 3D WebApp for Comprehensive Creative Technologies Project using react-three-fiber
9:01:02 PM: Preparing Git Reference refs/heads/main
9:01:05 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
9:01:05 PM: Starting build script
9:01:05 PM: Installing dependencies
9:01:05 PM: Python version set to 2.7
9:01:06 PM: v12.18.0 is already installed.
9:01:07 PM: Now using node v12.18.0 (npm v6.14.4)
9:01:07 PM: Started restoring cached build plugins
9:01:07 PM: Finished restoring cached build plugins
9:01:07 PM: Attempting ruby version 2.7.1, read from environment
9:01:09 PM: Using ruby version 2.7.1
9:01:09 PM: Using PHP version 5.6
9:01:09 PM: Started restoring cached yarn cache
9:01:09 PM: Finished restoring cached yarn cache
9:01:09 PM: Installing yarn at version 1.22.4
9:01:09 PM: Installing Yarn!
9:01:09 PM: > Downloading tarball…
9:01:09 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz → /tmp/yarn.tar.gz.gHsur1JtqA
9:01:09 PM: % Total % Received % Xferd Average Speed Time Time Time Current
9:01:09 PM: Dload Upload Total Spent Left Speed
9:01:09 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
9:01:09 PM: 100 79 100 79 0 0 319 0 --:–:-- --:–:-- --:–:-- 319
9:01:09 PM: 100 93 100 93 0 0 176 0 --:–:-- --:–:-- --:–:-- 176
9:01:10 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
9:01:10 PM: 100 625 100 625 0 0 765 0 --:–:-- --:–:-- --:–:-- 4528
9:01:10 PM: 100 1215k 100 1215k 0 0 929k 0 0:00:01 0:00:01 --:–:-- 929k
9:01:10 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc → /tmp/yarn.tar.gz.gHsur1JtqA.asc
9:01:10 PM: 100 83 100 83 0 0 1408 0 --:–:-- --:–:-- --:–:-- 1408
9:01:10 PM: 100 97 100 97 0 0 1116 0 --:–:-- --:–:-- --:–:-- 1116
9:01:10 PM: 100 629 100 629 0 0 5479 0 --:–:-- --:–:-- --:–:-- 5479
9:01:10 PM: 100 1028 100 1028 0 0 8159 0 --:–:-- --:–:-- --:–:-- 8159
9:01:10 PM: > Verifying integrity…
9:01:10 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
9:01:10 PM: gpg: Good signature from “Yarn Packaging yarn@dan.cx
9:01:10 PM: gpg: WARNING: This key is not certified with a trusted signature!
9:01:10 PM: gpg: There is no indication that the signature belongs to the owner.
9:01:10 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
9:01:10 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
9:01:10 PM: > GPG signature looks good
9:01:10 PM: > Extracting to ~/.yarn…
9:01:10 PM: > Adding to PATH... 9:01:11 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available. 9:01:11 PM: Started restoring cached node modules 9:01:11 PM: Finished restoring cached node modules 9:01:11 PM: Installing NPM modules using Yarn version 1.22.4 9:01:12 PM: yarn install v1.22.4 9:01:12 PM: [1/4] Resolving packages... 9:01:13 PM: [2/4] Fetching packages... 9:01:54 PM: info @netlify/traffic-mesh-agent-darwin-x64@0.27.10: The platform "linux" is incompatible with this module. 9:01:54 PM: info "@netlify/traffic-mesh-agent-darwin-x64@0.27.10" is an optional dependency and failed compatibility check. Excluding it from installation. 9:01:54 PM: info @netlify/traffic-mesh-agent-win32-x64@0.27.10: The platform "linux" is incompatible with this module. 9:01:54 PM: info "@netlify/traffic-mesh-agent-win32-x64@0.27.10" is an optional dependency and failed compatibility check. Excluding it from installation. 9:01:54 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module. 9:01:54 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. 9:01:54 PM: info fsevents@2.1.2: The platform "linux" is incompatible with this module. 9:01:54 PM: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation. 9:01:54 PM: info fsevents@1.2.12: The platform "linux" is incompatible with this module. 9:01:54 PM: info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation. 9:01:54 PM: [3/4] Linking dependencies... 9:01:54 PM: warning " > @testing-library/user-event@7.2.1" has unmet peer dependency "@testing-library/dom@>=5". 9:01:54 PM: warning "drei > r3f-troika > troika-three-utils@0.31.0" has incorrect peer dependency "three@0.103.x - 0.119.x". 9:01:54 PM: warning "netlify-cli > @octokit/rest > @octokit/plugin-request-log@1.0.3" has unmet peer dependency "@octokit/core@>=3". 9:01:54 PM: warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". 9:01:54 PM: warning "react-three-fiber > react-reconciler@0.26.1" has incorrect peer dependency "react@^17.0.1". 9:02:41 PM: [4/4] Building fresh packages... 9:02:45 PM: Done in 93.60s. 9:02:46 PM: NPM modules installed using Yarn 9:02:46 PM: Started restoring cached go cache 9:02:46 PM: Finished restoring cached go cache 9:02:46 PM: go version go1.14.4 linux/amd64 9:02:46 PM: go version go1.14.4 linux/amd64 9:02:46 PM: Installing missing commands 9:02:46 PM: Verify run directory 9:02:48 PM: ​ 9:02:48 PM: ──────────────────────────────────────────────────────────────── 9:02:48 PM: Netlify Build 9:02:48 PM: ──────────────────────────────────────────────────────────────── 9:02:48 PM: ​ 9:02:48 PM: ❯ Version 9:02:48 PM: @netlify/build 9.9.7 9:02:48 PM: ​ 9:02:48 PM: ❯ Flags 9:02:48 PM: apiHost: api.netlify.com 9:02:48 PM: cacheDir: /opt/build/cache 9:02:48 PM: deployId: 60511c89f6166708384e9ecc 9:02:48 PM: mode: buildbot 9:02:48 PM: testOpts: 9:02:48 PM: silentLingeringProcesses: '' 9:02:48 PM: ​ 9:02:48 PM: ❯ Current directory 9:02:48 PM: /opt/build/repo 9:02:48 PM: ​ 9:02:48 PM: ❯ Config file 9:02:48 PM: No config file was defined: using default values. 9:02:48 PM: ​ 9:02:48 PM: ❯ Context 9:02:48 PM: production 9:02:48 PM: ​ 9:02:48 PM: ──────────────────────────────────────────────────────────────── 9:02:48 PM: 1. Build command from Netlify app 9:02:48 PM: ──────────────────────────────────────────────────────────────── 9:02:48 PM: ​ 9:02:48 PM: CI=false yarn build
9:02:48 PM: yarn run v1.22.10
9:02:48 PM: $ react-scripts build
9:02:50 PM: Creating an optimized production build…
9:02:53 PM: Browserslist: caniuse-lite is outdated. Please run the following command: npx browserslist --update-db
9:03:55 PM: Compiled with warnings.
9:03:55 PM:
9:03:55 PM: ./src/components/LevelSelect.js
9:03:55 PM: Line 11:11: ‘activeLevel’ is assigned a value but never used no-unused-vars
9:03:55 PM: ./src/components/stages/Overworld.js
9:03:55 PM: Line 31:19: ‘setMuted’ is assigned a value but never used no-unused-vars
9:03:55 PM: Line 223:10: ‘pressed’ is assigned a value but never used no-unused-vars
9:03:55 PM: Search for the keywords to learn more about each warning.
9:03:55 PM: To ignore, add // eslint-disable-next-line to the line before.
9:03:55 PM: File sizes after gzip:
9:03:55 PM: 366.49 KB build/static/js/2.08972944.chunk.js
9:03:55 PM: 17.14 KB build/static/js/main.ef423a27.chunk.js
9:03:55 PM: 9.45 KB build/static/js/3.3b3f3f27.chunk.js
9:03:55 PM: 4.41 KB build/static/css/main.f51501bd.chunk.css
9:03:55 PM: 1.17 KB build/static/js/runtime-main.292a2bbc.js
9:03:55 PM: The project was built assuming it is hosted at ./.
9:03:55 PM: You can control this with the homepage field in your package.json.
9:03:55 PM: The build folder is ready to be deployed.
9:03:55 PM: Find out more about deployment here:
9:03:55 PM: bit.ly/CRA-deploy
9:03:55 PM: Done in 66.68s.
9:03:55 PM: ​
9:03:55 PM: (build.command completed in 1m 7.1s)
9:03:55 PM: ​
9:03:55 PM: ────────────────────────────────────────────────────────────────
9:03:55 PM: 2. Deploy site
9:03:55 PM: ────────────────────────────────────────────────────────────────
9:03:55 PM: ​
9:03:55 PM: Starting to deploy site from ‘build’
9:03:55 PM: Creating deploy tree
9:03:55 PM: Creating deploy upload records
9:03:55 PM: 0 new files to upload
9:03:55 PM: 0 new functions to upload
9:03:55 PM: Site deploy was successfully initiated
9:03:55 PM: ​
9:03:55 PM: (Deploy site completed in 286ms)
9:03:55 PM: ​
9:03:55 PM: ────────────────────────────────────────────────────────────────
9:03:55 PM: Netlify Build Complete
9:03:55 PM: ────────────────────────────────────────────────────────────────
9:03:55 PM: ​
9:03:55 PM: (Netlify Build completed in 1m 7.5s)
9:03:55 PM: Caching artifacts
9:03:55 PM: Started saving node modules
9:03:55 PM: Finished saving node modules
9:03:55 PM: Started saving build plugins
9:03:55 PM: Finished saving build plugins
9:03:55 PM: Started saving yarn cache
9:03:55 PM: Finished saving yarn cache
9:03:55 PM: Started saving pip cache
9:03:55 PM: Starting post processing
9:03:55 PM: Post processing - HTML
9:03:55 PM: Finished saving pip cache
9:03:55 PM: Started saving emacs cask dependencies
9:03:55 PM: Post processing - header rules
9:03:56 PM: Finished saving emacs cask dependencies
9:03:56 PM: Started saving maven dependencies
9:03:56 PM: Post processing - redirect rules
9:03:56 PM: Finished saving maven dependencies
9:03:56 PM: Started saving boot dependencies
9:03:56 PM: Finished saving boot dependencies
9:03:56 PM: Started saving rust rustup cache
9:03:56 PM: Finished saving rust rustup cache
9:03:56 PM: Started saving go dependencies
9:03:56 PM: Finished saving go dependencies
9:03:56 PM: Post processing done
9:03:56 PM: Site is live :sparkles:
9:03:59 PM: Build script success
9:04:54 PM: Finished processing build request in 3m55.67077626s

hey @spikethea , welcome.

I took a look at your site and you have some strange paths which might be the cause of the problem:

generally, you don’t want a dot in the path like that - if you are trying to have a relative path from root, a / is fine, or a regular relative path without the /, or even an absolute path: http:///https://servicelearn.netlify.app/ but the dot isn’t standard and likely the cause of your woes.

can you try changing your paths and see if that helps?