Module not found while deploying a MERN app to render

Getting this error:

Module not found: Error: Can’t resolve ‘./components/PrivateRoute’ in ‘/opt/render/project/src/frontend/src’

Even though everything runs smootly locally, even the build command works as expected when trying locally, tried renaming, recreating, rewriting the files but nothing still the same module not found error.

It’s a MERN App named proshop ecommerce! (github.com)

Any help will be appreciated

Hey,

Your service is deploying on Linux machines and Linux is case sensitive. Look at the error message and the lowercase at ‘/components/…’ vs the uppercase on your repo at the same path: https://github.com/burhaann/MERN-Ecommerce-Shop/tree/main/frontend/src/Components

Jérémy.
Render Support, UTC+3

1 Like

Thanks a lot
Can’t thank you enough…
I Couldn’t have picked up on this issue in a thousand years because my local repo somehow already had a lower cased /components/ folder and i first had to rename it to something else then push to git and the rename it to lowercase components and push to git again.

THANKS A LOT, IT WORKED!

image_2024-02-15_204728520

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.