trouble working with npm workspaces
arhammusheer
HOBBYOP

2 years ago

Hey I'm working in a new pattern than usual which is a monorepo using npm workspaces

My build failed after i introduced a shared package and it says error TS2307: Cannot find module '@local/keylib' or its corresponding type declarations.

I am using the root directory config in railway. Does that throw out the code outside from workspace? This could be why it can't reference code from other workspaces. Any help?

9 Replies

arhammusheer
HOBBYOP

2 years ago

cd11aa3e-055b-41a8-ba34-f9827ba92cfb


brody
EMPLOYEE

2 years ago

you are absolutely correct, only the set directory is copied, for packages that share code or types you wouldn't want to set a root directory


arhammusheer
HOBBYOP

2 years ago

I see, i'll try adding custom config in my dockerfiles


arhammusheer
HOBBYOP

2 years ago

Would watch path be affected in any way? I don't want useless unchanged deploys


brody
EMPLOYEE

2 years ago

they shouldn't


arhammusheer
HOBBYOP

2 years ago

Aight I didn't think this through. Is this still possible

I want to use the keyclient as my shared library

core-service and keymanager-service are seperate railway services


arhammusheer
HOBBYOP

2 years ago

Will railway be able to support a monorepo structure like this or should i break it up


brody
EMPLOYEE

2 years ago

yeah seems fine to me, keep the root directory as the root and set the location to the dockerfiles via the service variable


arhammusheer
HOBBYOP

2 years ago

Thanks!


Loading...