0

I have a react app which build and deploys fine on my development environment. Now I did some refactoring which was limited to moving a few files, commiting, testing and redeploying. After the latest change I deployed to productiong and found that on production I got a 404 when accessing the site. 404 not found. I'm completely stumped as to what may be the problem.

Reviewing the bitbucket pipeline I get the following output:

./src/pages/Home.jsx
Cannot find file '../components/narrative/Narrative' in './src/pages'.

Now if I have a look at './src/pages/Home.jsx' I can see I'm importing the below

import Narrative from "../components/narrative/Narrative"

And that file does indeed exist:

enter image description here

The full output of the pipeline is here:

root@ubuntu-web:~/eg-web# npm run build
> refgator-web@0.1.0 build /root/eg-web
> react-scripts build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Failed to compile.
./src/pages/Home.jsx
Cannot find file '../components/narrative/Narrative' in './src/pages'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! refgator-web@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the refgator-web@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-02-16T10_23_04_697Z-debug.log

And if I go to the production server this is the latest error log:

enter image description here

TheMightyLlama
  • 1,243
  • 1
  • 19
  • 51

1 Answers1

0

This was actually caused by the folder name as it is locally called narrative. On the repo it's Narrative

I changed this with help from this answer In a Git repository, how to properly rename a directory?

TheMightyLlama
  • 1,243
  • 1
  • 19
  • 51