a month ago
I’m encountering a persistent
on Railway:
Code
TS2307: Cannot find module '../../externals/propyleeapi-typescript/dist/index.js'
The module does exist in my build output (externals/propyleeapi-typescript/dist/index.js), and the SDK compiles correctly locally. My Dockerfile uses a multi‑stage build where the SDK is compiled in the builder stage and copied into the runner stage.
Locally:
dist/index.js is present
NodeNext + ESM imports resolve correctly
The project builds without errors
On Railway:
The same path is reported as missing
TS2307 occurs during the TypeScript build step
The file appears not to be visible inside the runner image
I would like to understand why Railway’s build environment cannot resolve a module that exists in the builder stage and is copied into the runner stage. Is there anything specific about Railway’s NodeNext/ESM resolution, Docker layer copying, or filesystem visibility that could explain this discrepancy?
Thank you,
Phi
Attachments
Pinned Solution
a month ago
Is your root directory set up correctly in your service settings for the docker build context?
2 Replies
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 1 month ago
a month ago
Is your root directory set up correctly in your service settings for the docker build context?
Status changed to Solved uxuz • about 1 month ago
