Skip to content

Many demos fail to run on Node version 21 with "Function.prototype.apply was called on undefined" errors #59

@ddribin

Description

@ddribin

I am trying to use component/tex2svg and it fails with this error using Node v21.6.2. However it works with Node v20.11.1. I am on a macOS Sonoma 14.3 with both version of node installed via Homebrew. Also note that the demos in direct/ work on Node v21.6.2, but the ones in component/ and simple/ do not.

Here's the truncated error:

> /opt/homebrew/opt/node@21/bin/node -r esm ./tex2svg 'y = mx + b'
/Users/dave/src/MathJax-demos-node/node_modules/esm/esm.js:1
const __global__ = this; <... full-text-in-gist ... >


[/Users/dave/src/MathJax-demos-node/node_modules/cliui/build/index.cjs:1
TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function]

Node.js v21.6.2

The full error is big, so I put it in a Gist: https://gist.github.com/ddribin/8d1bf990f8edd87cdb14cf705b03b020

Metadata

Metadata

Assignees

No one assigned

    Labels

    AcceptedIssue has been reproduced by MathJax team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions