-
Notifications
You must be signed in to change notification settings - Fork 221
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
hyperdx cannot be deployed without rebuilding frontends #462
Comments
Hi @etiennea definitely agree, unfortunately with Next.js it isn't super straightforward to have the variables baked dynamically and we have yet to find a straightforward solution to do so. We're open to ideas/approaches on how to improve this (or even PRs). We've evaluated using packages such as Just linking this with #12 where we've had some prior conversations around this. |
Had similar issues with openpanel and solved it with a custom entrypoint. Not the "cleanest" solutions but it works very well.
|
@lindesvard oh wow - I was thinking about this at one point... but was hoping we didn't need to resort to string replacement (and I was worried that we can't even do it correctly!). That being said that implementation is quite clever! I'm hoping that we can adopt #498 into v2 for this purpose. |
I'm guessing the In .next/server/pages/api/config.js:1:"use strict";(()=>{var e={id:589,ids:[589]};e.modules={145:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},7558:(e,r,s)=>{s.r(r),s.d(r,{config:()=>d,default:()=>p,routeModule:()=>u});var t={};s.r(t),s.d(t,{default:()=>l});var a=s(1802),o=s(7153),i=s(6249);const n=process.env.HYPERDX_API_KEY;process.env.NEXT_PUBLIC_IS_OSS,process.env.NEXT_PUBLIC_IS_LOCAL_MODE;
function l(e,r){r.status(200).json({apiKey:n,apiServerUrl:"http://localhost:8000",collectorUrl:"http://localhost:4318",serviceName:"hdx-oss-dev-app"})} so env variable is not even read at runtime. But in .next/server/pages/api/config.js:1:"use strict";(()=>{var e={id:589,ids:[589]};e.modules={145:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},7558:(e,r,s)=>{s.r(r),s.d(r,{config:()=>_,default:()=>u,routeModule:()=>E});var o={};s.r(o),s.d(o,{default:()=>d});var t=s(1802),a=s(7153),n=s(6249);
const i=process.env.NEXT_PUBLIC_SERVER_URL||"http://localhost:8000",p=process.env.HYPERDX_API_KEY,l=process.env.NEXT_PUBLIC_OTEL_SERVICE_NAME||"hdx-oss-dev-app",c=process.env.NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT||"http://localhost:4318";process.env.NEXT_PUBLIC_IS_OSS;
function d(e,r){r.status(200).json({apiKey:p,apiServerUrl:i,collectorUrl:c,serviceName:l})} I wonder what caused the difference. |
Having to run build-local just to bake some environment vars into the UIs is very annoying.
There is no reason the UIs cannot pull these at runtime from env vars like the backend does.
The text was updated successfully, but these errors were encountered: