Custom start command env troubleshooting

4 months ago

Currently I have the following as my start command for a Next.js app:

/bin/sh -c "export NEXT_PUBLIC_ASSET_PREFIX=$(cat ASSET_PREFIX) && node server.js"

ASSET_PREFIX is a file with the content being the public URL for CDN assets

sshing into the service and cat ASSET_PREFIX works fine

The problem is, NEXT_PUBLIC_ASSET_PREFIX doesn't appear to get set

Solved$10 Bounty

3 Replies

4 months ago

Can't do a variable from Railway because the URL written to ASSET_PREFIX depends on RAILWAY_GIT_COMMIT_SHA which cannot be referenced from the UI (will just be blank)


4 months ago

oh wait NEXT_PUBLIC_ is done at build time


4 months ago

might be the problem hihi


Status changed to Solved brody 4 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...