TypeScript error
baobab-kernel
HOBBYOP

a month ago

I’m encountering a persistent

TS2307.PNG

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

Solved$10 Bounty

Pinned Solution

Is your root directory set up correctly in your service settings for the docker build context?

2 Replies

Railway
BOT

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


Is your root directory set up correctly in your service settings for the docker build context?


baobab-kernel
HOBBYOP

a month ago

thank you ! it was a part of job to be done.


Status changed to Solved uxuz • about 1 month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...