Build Cache bug?
jalenzzz
PROOP

2 months ago

I have a service availability ticker I show on the website controlled by an env variable, locally I confirmed it works, so now I pushed code to change the content of the ticker, and then once that was done I switched the env to true meaning show the banner on the website, but it isn't showing, after a cached build. Which I'm assuming is causing this issue.

23 Replies

jalenzzz
PROOP

2 months ago

image.png

Attachments


jalenzzz
PROOP

2 months ago

ive asked other users as well and they dont see the ticker


jalenzzz
PROOP

2 months ago

This is what prod looks like

Screenshot_20260331_145856.png

Attachments


jalenzzz
PROOP

2 months ago

when it's meant to show

image.png

Attachments


jalenzzz
PROOP

2 months ago

It's a next JS application for context


jalenzzz
PROOP

2 months ago

Pushed something small so a cache build doesnt occur and now users can see the ticker


jalenzzz
PROOP

2 months ago

bump


2 months ago

Yeah if the environment variables are read in at build time and not referenced at runtime a cached build would cause this. What stack are you on? would be interested to see why that's happening.

If you're doing server side rendered pages that reference environment variables on each request build cache shouldn't matter


2 months ago

If you can share the code (or a minimum repro of it) that generates that banner would be happy to point ya in the right direction


jalenzzz
PROOP

2 months ago

Hello, sorry for the late response



jalenzzz
PROOP

2 months ago

and it's imported to the Header component for desktop and mobile layouts


jalenzzz
PROOP

2 months ago

I control it with a flag of NEWS_TICKER to determine whether to show it or not


2 months ago

Yeah these only get changed on build cause they're injected at build in the feature flags file


2 months ago

So flipping the flag triggers a rebuild and that's what injects the variable and sets the flag. If the build is skipped the change doesn't take effect


jalenzzz
PROOP

2 months ago

Ah I see


jalenzzz
PROOP

2 months ago

So it's best I have it off right


jalenzzz
PROOP

2 months ago

The build caching


jalenzzz
PROOP

2 months ago

Since next js I figure embeds them at build time


2 months ago

Yeah if you want to rely on a rebuild for feature flags you would have to.

There are other ways to do flags though if you want them to be more instant.


2 months ago

I.e. you could put your flags into your API


2 months ago

Just means an extra API request when your client hydrates


jalenzzz
PROOP

2 months ago

I see, alright


Welcome!

Sign in to your Railway account to join the conversation.

Loading...