#1148806 node-katex: libjs-katex's ES module entry imports @babel/runtime, which nothing depends on

#1148806#5
Date:
2026-09-24 02:09:24 UTC
From:
To:
Hi,

The ES module entry that /usr/share/nodejs/katex/package.json exports as
"import" - /usr/share/javascript/katex/katex.mjs - begins with

    import _defineProperty from '@babel/runtime/helpers/defineProperty';

but neither libjs-katex nor katex has node-babel7-runtime (which is what
installs /usr/share/nodejs/@babel/runtime) in its Depends.  So importing
katex as an ES module fails on any system where nothing else happens to
pull that package in:

    $ node --input-type=module -e 'import("katex")'
    file:///usr/share/javascript/katex/katex.mjs:1
    import _defineProperty from '@babel/runtime/helpers/defineProperty';
    ^
    Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@babel/runtime'
    imported from /usr/share/javascript/katex/katex.mjs

Installing node-babel7-runtime makes it work (the lookup from
/usr/share/javascript/katex/ finds it through /usr/share/node_modules,
which is a symlink to /usr/share/nodejs).