Build failing with Rollup Error - Could not resolve - ./Pages/Home/Home from src/App.jsx

Hello Friendly Forum Fiends :wave:

I hope someone might be able to help a Netlify-Newbie :innocent:
I am trying to follow community guidelines best I can, please correct me if I have done something incorrectly.

This is React project built with Vite, everything is fine running localhost and i believe no typos occurred. i was suspecting that when building the project not getting the jsx file.
GitHub Repo: (main branch)
https://github.com/CongChuong1909/petFamily/tree/main/Client

MyBuild Setting on netlify.
Screenshot 2023-08-05 101212

all paths in app.jsx file are wrong not only ./Pages/Home/Home

10:51:47 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
10:51:45 PM: Netlify Build                                                 
10:51:45 PM: ────────────────────────────────────────────────────────────────
10:51:45 PM: ​
10:51:45 PM: ❯ Version
10:51:45 PM:   @netlify/build 29.17.4
10:51:45 PM: ​
10:51:45 PM: ❯ Flags
10:51:45 PM:   baseRelDir: true
10:51:45 PM:   buildId: 64cd1e4d74696f2d4b4b9de5
10:51:45 PM:   deployId: 64cd1e4d74696f2d4b4b9de7
10:51:45 PM: ​
10:51:45 PM: ❯ Current directory
10:51:45 PM:   /opt/build/repo/Client
10:51:45 PM: ​
10:51:45 PM: ❯ Config file
10:51:45 PM:   No config file was defined: using default values.
10:51:45 PM: ​
10:51:45 PM: ❯ Context
10:51:45 PM:   production
10:51:45 PM: ​
10:51:45 PM: Build command from Netlify app                                
10:51:45 PM: ────────────────────────────────────────────────────────────────
10:51:45 PM: ​
10:51:45 PM: $ CI='' npm run build
10:51:45 PM: > client@0.0.0 build
10:51:45 PM: > vite build
10:51:45 PM: vite v4.4.8 building for production...
10:51:45 PM: transforming...
10:51:46 PM: βœ“ 33 modules transformed.
10:51:46 PM: βœ“ built in 253ms
10:51:46 PM: Could not resolve ./Pages/Home/Home from src/App.jsx
10:51:46 PM: file: /opt/build/repo/Client/src/App.jsx
10:51:46 PM: error during build:
10:51:46 PM: RollupError: Could not resolve ./Pages/Home/Home from src/App.jsx
10:51:46 PM:     at error (file:///opt/build/repo/Client/node_modules/rollup/dist/es/shared/node-entry.js:2245:30)
10:51:46 PM:     at ModuleLoader.handleInvalidResolvedId (file:///opt/build/repo/Client/node_modules/rollup/dist/es/shared/node-entry.js:24734:24)
10:51:46 PM:     at file:///opt/build/repo/Client/node_modules/rollup/dist/es/shared/node-entry.js:24696:26
10:51:46 PM: ​
10:51:46 PM: build.command failed                                        
10:51:46 PM: ────────────────────────────────────────────────────────────────
10:51:46 PM: ​
10:51:46 PM:   Error message
10:51:46 PM:   Command failed with exit code 1: CI='' npm run build (https://ntl.fyi/exit-code-1)
10:51:46 PM: ​
10:51:46 PM:   Error location
10:51:46 PM:   In Build command from Netlify app:
10:51:46 PM:   CI='' npm run build
10:51:46 PM: ​
10:51:46 PM:   Resolved config
10:51:46 PM:   build:
10:51:46 PM:     base: /opt/build/repo/Client
10:51:46 PM:     command: CI='' npm run build
10:51:46 PM:     commandOrigin: ui
10:51:46 PM:     publish: /opt/build/repo/Client/dist
10:51:46 PM:     publishOrigin: ui
10:51:47 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:51:47 PM: Failing build: Failed to build site
10:51:48 PM: Finished processing build request in 36.518s

Thank you in advance for anyone who takes the time to point me in the right direction.

Sorry for the late reply, I can be sure I have no typos or upper or lower case letters affecting this. you can check my github. I have checked it very carefully.

There’s the error. You’ve a upper case p in Pages.

In your GitHub repo, it’s a lowercase p:

image

1 Like