perspective-dev/perspective · error

Failed to load font

Error message

Failed to load font ${d.family}:

What it means

In the font-loader worker, FontFace.load() rejected for the given family (bad src URL, CORS failure, unsupported format, or network error). This is deliberately non-fatal: it is only a console.warn in a catch block so chart rendering continues with fallback fonts.

Solutions

  1. Check the font src URL is reachable and served with CORS headers
  2. Ensure the font format (woff2/woff) is supported by the target browser
  3. Provide a CSS font-family fallback so text renders with a system font
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/viewer-charts/src/ts/worker/font-loader.ts:83 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of perspective-dev/perspective@11c8238c0c (2026-09-09). Data as JSON: /api/errors/07f894ade6680de5. Report an issue: GitHub.

Appendix: source

Thrown at packages/viewer-charts/src/ts/worker/font-loader.ts:83

            // }

            // if (d.variant) {
            //     (descriptors as any).variant = d.variant;
            // }

            // if (d.featureSettings) {
            //     descriptors.featureSettings = d.featureSettings;
            // }

            // if (d.display) {
            //     (descriptors as any).display = d.display;
            // }

            const face = new FontFace(d.family, d.src, descriptors);
            await face.load();
            (self as any).fonts.add(face);
        } catch (err) {
            console.warn(`Failed to load font ${d.family}:`, err);
        }
    })();

    FONT_LOADS.set(key, p);
    await p;
}

View on GitHub (pinned to 11c8238c0c)