Skip to content

Flags worked in local but not in prod #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
naqi opened this issue Mar 25, 2025 · 5 comments
Open

Flags worked in local but not in prod #112

naqi opened this issue Mar 25, 2025 · 5 comments

Comments

@naqi
Copy link

naqi commented Mar 25, 2025

Thank you for building this library. I had a special use case and this fit it perfectly! The documentation and example have been super helpful in getting this implemented in a day.

Having said that it took an other day to get it working in our production env. I enabled toolbar for preview and prod builds. Browser extension is installed and I am logged in to my Vercel account. I only have one Vercel account so there was no chance I would be signed in to wrong account.

Image

After redeploy, I started seeing the toolbar. However, flags explorer kept showing blank slate. Digging deeper I noticed that Flags Endpoint was getting 401 errors in production deployment.

Image

Image

When making the same call from a curl request I was getting 200.

curl --location 'https://example.com/.well-known/vercel/flags' \
--header 'Authorization: Bearer token_extracted_from_other_request'

Today I noticed a setting in the Toolbar which seemed odd to me since I had already enabled toolbar.

Image

After tapping it, I got a list of domains for my deployment. Once I selected a domain I can now see my feature flags.

Is this expected behavior?

@naqi
Copy link
Author

naqi commented Mar 26, 2025

Another thing to note. Flag Explorer seems to only work with *.vercel.app domains. I can enable it on custom domain but I am seeing the same behavior. 401s for Flags Endpoint and empty state for Flags Explorer

@WITS
Copy link
Member

WITS commented Apr 2, 2025

Hi @naqi! Can you share the domain where you were experiencing this issue? The Flags Explorer is not limited to *.vercel.app domains, so I suspect there is another issue at play here

@naqi
Copy link
Author

naqi commented Apr 3, 2025

@WITS Sure, our custom domain is https://app.staging.makeswift.com

@naqi
Copy link
Author

naqi commented Apr 10, 2025

There is some update.

After clearing my cookies, for all time, in chrome. I am now able to see the feature flags. I am guessing some cookie was the cause?

However, when I tried a fresh browser Firefox it does not work. I can't even get the toolbar to show up. One of my team members is running developer version of Firefox and that seems to be loading the toolbar.

@WITS
Copy link
Member

WITS commented Apr 14, 2025

I'm happy to hear that it's mostly working now. 🙂

I don't believe that we have anything at a platform level that would behave differently for the flags endpoint depending on cookies. Is it possible that your application uses middleware, redirects, or rewrites that could intercept requests to the flags endpoint?

I'll share the Firefox issue with our team so we can look into it. Thank you for letting us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants