Problem
CloudflareTunnelClient.js line 39 crashes with:
Cannot read properties of undefined (reading 'startsWith')
The code:
tunnel.on("url", (url) => {
if (!url.startsWith("http")) { // url is undefined
url = `https://${url}`;
}
This produces hundreds of identical error log lines during startup:
[ERROR] [CLI] Failed to start edge application: Cannot read properties of undefined (reading 'startsWith')
Context
CLOUDFLARE_TOKEN is not set in the environment
- The
SharedApplicationServer has a guard (if (!this.skipTunnel && process.env.CLOUDFLARE_TOKEN)) that should prevent tunnel startup
- Despite this, the error fires repeatedly during startup before Cyrus stabilizes
- Cyrus eventually starts successfully (0 restarts, stable uptime) but the error log is polluted
Expected Behavior
- The
url callback should guard against undefined: if (url && !url.startsWith("http"))
- Or the tunnel client should never be instantiated when
CLOUDFLARE_TOKEN is absent
Environment
- Cyrus v0.2.37
- Self-hosted on Mac Mini (Apple Silicon)
- No
CLOUDFLARE_TOKEN configured
Problem
CloudflareTunnelClient.jsline 39 crashes with:The code:
This produces hundreds of identical error log lines during startup:
Context
CLOUDFLARE_TOKENis not set in the environmentSharedApplicationServerhas a guard (if (!this.skipTunnel && process.env.CLOUDFLARE_TOKEN)) that should prevent tunnel startupExpected Behavior
urlcallback should guard against undefined:if (url && !url.startsWith("http"))CLOUDFLARE_TOKENis absentEnvironment
CLOUDFLARE_TOKENconfigured