Skip to content

new SVG() crashing #3128

@pkra

Description

@pkra

Just a random note in case you consider it relevant

While

import { SVG } from 'mathjax-full/js/output/svg.js';
const svg = new SVG({});

is ok, this

import { SVG } from 'mathjax-full/js/output/svg.js';
const svg = new SVG();

throws for me (4-beta4) with

[snip]node_modules/mathjax-full/mjs/output/common.js:17
        const [fontClass, font] = (options.fontData instanceof FontData ?
                                           ^

TypeError: Cannot read properties of null (reading 'fontData')
    at new CommonOutputJax ([snip]node_modules/mathjax-full/mjs/output/common.js:17:44)
    at new SVG ([snip]node_modules/mathjax-full/mjs/output/svg.js:15:9)
    at [snip]mjtest.js:2:13
    at ModuleJob.run (node:internal/modules/esm/module_job:192:25)
    at async DefaultModuleLoader.import (node:internal/modules/esm/loader:228:24)
    at async loadESM (node:internal/process/esm_loader:40:7)
    at async handleMainPromise (node:internal/modules/run_main:66:12)

Node.js v20.5.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions