Need Help with Deployment Issue

Hello everyone,

I’m currently facing a “build” problem when trying to deploy my website. I recently added a new page, and ever since, I’ve been encountering this issue. Prior to that, the deployment was working perfectly.

4:20:01 PM: Netlify Build                                                 
4:20:01 PM: ────────────────────────────────────────────────────────────────
4:20:01 PM: ​
4:20:01 PM: ❯ Version
4:20:01 PM:   @netlify/build 29.24.0
4:20:01 PM: ​
4:20:01 PM: ❯ Flags
4:20:01 PM:   baseRelDir: true
4:20:01 PM:   buildId: 653fc98689250f0008520453
4:20:01 PM:   deployId: 653fc98689250f0008520455
4:20:01 PM: ​
4:20:01 PM: ❯ Current directory
4:20:01 PM:   /opt/build/repo
4:20:01 PM: ​
4:20:01 PM: ❯ Config file
4:20:01 PM:   No config file was defined: using default values.
4:20:01 PM: ​
4:20:01 PM: ❯ Context
4:20:01 PM:   production
4:20:01 PM: ​
4:20:01 PM: Build command from Netlify app                                
4:20:01 PM: ────────────────────────────────────────────────────────────────
4:20:01 PM: ​
4:20:01 PM: $ npm run build
4:20:01 PM: > client@0.0.0 build
4:20:01 PM: > vite build
4:20:01 PM: vite v4.3.9 building for production...
4:20:01 PM: transforming...
4:20:02 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
4:20:02 PM: ✓ 33 modules transformed.
4:20:02 PM: ✓ built in 332ms
4:20:02 PM: Could not resolve "./pages/home/peche/peche" from "src/App.jsx"
4:20:02 PM: file: /opt/build/repo/src/App.jsx
4:20:02 PM: error during build:
4:20:02 PM: RollupError: Could not resolve "./pages/home/peche/peche" from "src/App.jsx"
4:20:02 PM:     at error (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:2124:30)
4:20:02 PM:     at ModuleLoader.handleInvalidResolvedId (file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:23990:24)
4:20:02 PM:     at file:///opt/build/repo/node_modules/rollup/dist/es/shared/node-entry.js:23952:26
4:20:02 PM: ​
4:20:02 PM: "build.command" failed                                        
4:20:02 PM: ────────────────────────────────────────────────────────────────
4:20:02 PM: ​
4:20:02 PM:   Error message
4:20:02 PM:   Command failed with exit code 1: npm run build (
4:20:02 PM: ​
4:20:02 PM:   Error location
4:20:02 PM:   In Build command from Netlify app:
4:20:02 PM:   npm run build
4:20:02 PM: ​
4:20:02 PM:   Resolved config
4:20:02 PM:   build:
4:20:02 PM:     command: npm run build
4:20:02 PM:     commandOrigin: ui
4:20:02 PM:     environment:
4:20:02 PM:       - TOKEN_SECRET
4:20:02 PM:       - VITE_BACKEND_URL
4:20:02 PM:     publish: /opt/build/repo/dist
4:20:02 PM:     publishOrigin: ui
4:20:02 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:20:02 PM: Failing build: Failed to build site
4:20:02 PM: Finished processing build request in 17.109s

Has anyone else experienced something similar, or does anyone have any suggestions on how to resolve this? Your assistance would be greatly appreciated.

Thank you in advance!

Hi @bef4 , thanks for the post and welcomel.
The error is happening on the line below

Make sure the path to peche is correct since you are importing it in the App.jsx file.

Let me know the outcome.


Hi Clarence !

Your quick reply is much appreciated !!

I don’t believe the issue is related to the path of the file. The reason I say this is that the site works perfectly fine locally. The problem only seems to occur during deployment.

If you have any other suggestions or insights, I would greatly appreciate them.



Thanks for the feeback @bef4
Kindly check the resources below since it is similar to your problem.

Let us know if the above helped you resolved the problem.

Hi Clarence,

I wanted to thank you for the resources you shared.

They were quite helpful, and I’m currently exploring the insights they provided.

Upon further investigation, it seems like the issue is likely related to the file path.

I’ve attached a screenshot highlighting the code I commented out, which allows the site to work without the “peche” page.

This finding reinforces my suspicion regarding the path.

I’ll continue to work on it and will keep you updated on any progress. Thanks for your assistance.

Best regards,


Hi @bef4 , glad to know the suggestions and resources shared helped.
Upon taking a look at the image shared it is still related to the resources shared.
As you can see the peche component filename is in lowercase whiles the filenames for the other imports such as NotFound, Write, e.t.c are in uppercase.

Kindly rename your peche file to Peche. Also make sure the name of the component you are also exporting is also in uppercase.

Finally make sure all the imports in all files also match the renamed filename in uppercase.


Hi Clarence,

Thank you for your response and for your valuable suggestions.

I’ve taken your advice and renamed the peche file to Peche, making sure that the first letter is in uppercase. I’ve also updated the exported component to match the new filename casing.

In addition, I’ve gone through all the import statements in my files and ensured they align with the renamed filename in uppercase.

The good news is that, despite an initial error message during the code push, the “Build” process on Netlify was successful, and the application has been deployed without any further issues. Strange…

Once again, thank you for your prompt guidance, and I’m grateful for your help in getting the project back on track.

Best regards,