21 days ago
I'm deploying a Node.js application to Railway and getting the following error during startup:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/src/V1/App/Seeders/index.js' imported from /app/server.js
Node.js v20.20.0
The application starts with:
> node server.js
The import in server.js is:
import './src/V1/App/Seeders/index.js'
What I already verified
The file exists locally at:
src/V1/App/Seeders/index.jsThe folder name casing matches exactly (
V1,App,Seeders)I am using macOS locally
I understand Linux is case-sensitive and confirmed the casing matches
The project is plain JavaScript (not TypeScript)
Node version in production:
v20.20.0
What’s confusing
The module works locally but fails inside the Railway container with ERR_MODULE_NOT_FOUND.
Could this be:
A case-sensitivity issue that Git didn’t track correctly?
A file not committed?
A
.gitignoreissue?A build vs runtime working directory issue?
Project Structure (simplified)
server.js
src/
└── V1/
└── App/
└── Seeders/
└── index.js
Any guidance would be appreciated.
Pinned Solution
21 days ago
No, I found that the error was directly from my tests; it had nothing to do with my configuration or case sensitivity. It was strange and difficult to find.
3 Replies
21 days ago
Likely wrong casing in the import path as macos filesystem is case insensitive Linux is case sensitive.
21 days ago
Are you using a monorepo? What are the settings that you are using on railway to build your app?
21 days ago
No, I found that the error was directly from my tests; it had nothing to do with my configuration or case sensitivity. It was strange and difficult to find.
Status changed to Solved brody • 15 days ago