GrapesJS/grapesjs · warning

Failed to send telemetry data ${await response.text()}

Error message

Failed to send telemetry data ${await response.text()}

What it means

GrapesJS EditorView optionally sends anonymous telemetry (domain, version) to `${telemetryUrl}/api/gjs/telemetry/collect`. If the POST returns a non-OK status, it throws an Error embedding the response body. Because this runs in the editor constructor, a failing telemetry endpoint can abort editor initialization.

Source

Thrown at packages/core/src/editor/view/EditorView.ts:85

    }

    const sessionKeyPrefix = 'gjs_telemetry_sent_';
    const { version } = this.model;
    const sessionKey = `${sessionKeyPrefix}${version}`;

    if (sessionStorage.getItem(sessionKey)) {
      // Telemetry already sent for version this session
      return;
    }

    const url = 'https://app.grapesjs.com';
    const response = await fetch(`${url}/api/gjs/telemetry/collect`, {
      method: 'POST',
      body: JSON.stringify({ domain, version }),
    });

    if (!response.ok) {
      throw new Error(`Failed to send telemetry data ${await response.text()}`);
    }

    sessionStorage.setItem(sessionKey, 'true');

    Object.keys(sessionStorage).forEach((key) => {
      if (key.startsWith(sessionKeyPrefix) && key !== sessionKey) {
        sessionStorage.removeItem(key);
      }
    });

    this.trigger(EditorEvents.telemetryInit);
  }
}

View on GitHub (pinned to 2bdeda85b8)

Solutions

  1. Disable telemetry in the editor config (there is a telemetry/telemetryUrl option) if you don't need it.
  2. Check network access to the telemetry URL and any proxy/ad-block interference.
  3. Wrap editor creation or upgrade your GrapesJS version — newer versions handle telemetry failures gracefully instead of throwing in the constructor.
  4. If self-hosting telemetry, verify the `/api/gjs/telemetry/collect` endpoint returns 2xx.

Example fix

// before
const editor = grapesjs.init({ container: '#gjs' }); // constructor throws if telemetry POST fails
// after
const editor = grapesjs.init({ container: '#gjs', telemetry: false });
Defensive patterns

Strategy: fallback

Validate before calling

const telemetryUrl = config.telemetryUrl;
if (telemetryUrl) {
  try {
    const r = await fetch(`${telemetryUrl}/api/gjs/telemetry/collect`, { method: 'OPTIONS' });
    if (!r.ok) config = { ...config, telemetry: false };
  } catch { config = { ...config, telemetry: false }; }
}

Type guard

null

Try / catch

try {
  const editor = grapesjs.init(config);
} catch (err) {
  if (String(err.message).startsWith('Failed to send telemetry data')) {
    const editor = grapesjs.init({ ...config, telemetry: false });
  } else throw err;
}

Prevention

When it happens

Trigger: Creating an editor with telemetry enabled while the telemetry endpoint is unreachable, returns 4xx/5xx, or is blocked (ad blockers, corporate proxies, offline environments).

Common situations: Self-hosted GrapesJS with default telemetry URL behind a firewall; offline/intranet usage; ad-blockers blocking the /api/gjs/telemetry/collect path; misconfigured telemetry URL.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of GrapesJS/grapesjs@2bdeda85b8 (2026-08-30). Data as JSON: /api/errors/205bc501adf9c727. Report an issue: GitHub.