Bug (I think)
Running the app after copying .env.example to .env (as instructed) causes an UnhandledPromiseRejectionWarning on both dev and package builds - that prevents the window from opening (only on mac and I can't find the reason why it works on windows test build).
UnhandledPromiseRejectionWarning: Error: Configuration: Could not parse user-provided export URL: 'xxx/i/v1/logs'
Cause
initOtelTransport in otel-log-transport.ts (introduced in #1278) only guards against empty values:
if (!apiKey || !apiHost) {
return noop;
}
.env.example ships with xxx as a placeholder, which is truthy and passes this check. The exporter then receives xxx/i/v1/logs as the URL, which isn't parseable.
This doesn't affect developers with real PostHog API credentials — only those using the default placeholder values.
Fix
Validate the URL before passing it to the exporter:
const url = `${apiHost}/i/v1/logs`;
try {
new URL(url);
} catch {
return noop;
}
I put this fix into the windows PR
Bug (I think)
Running the app after copying
.env.exampleto.env(as instructed) causes anUnhandledPromiseRejectionWarningon both dev and package builds - that prevents the window from opening (only on mac and I can't find the reason why it works on windows test build).Cause
initOtelTransportinotel-log-transport.ts(introduced in #1278) only guards against empty values:.env.exampleships withxxxas a placeholder, which is truthy and passes this check. The exporter then receivesxxx/i/v1/logsas the URL, which isn't parseable.This doesn't affect developers with real PostHog API credentials — only those using the default placeholder values.
Fix
Validate the URL before passing it to the exporter:
I put this fix into the windows PR