-
Notifications
You must be signed in to change notification settings - Fork 371
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
bug: Public and secret keys should not be required at build time #1829
Comments
Thanks for reporting, I think the best way forward here is to just disable langfuse tracing if no secrets are configured instead of throwing exceptions. This'd be helpful to only run instrumentation in certain environments and not in tests. |
I'm concerned that silently disabling Langfuse will trip up people when setting up the project. I guess there should be a way to require an env var during runtime but not during build time? Sounds like a common problem to encounter. |
I'd suggest logging a single warning ("langfuse environment variables not set, tracing disabled"). I think I have seen this behavior with Sentry, Betterstack, Posthog, … |
Yes, that sounds reasonable 👍 |
Moved this to #1910 as there was another user requesting this |
Describe the bug
The public key and secret key are required when building the application with Vite. I think they should only be required at runtime, so the build system does not need to know the keys used when running the application.
To reproduce
https://stackblitz.com/edit/sveltejs-kit-template-default-qeurfm?file=src%2Froutes%2F%2Bpage.server.js
Run
npm run build
in the terminal. You'll get the errorAdditional information
I'm using the JS/TS SDK.
The text was updated successfully, but these errors were encountered: