[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to deal with source maps (was Re: Typescript definitions in binary packages)



On 8/28/25 19:51, Jérémy Lal wrote:

Le jeu. 28 août 2025 à 19:47, Julian Gilbey <jdg@debian.org <mailto:jdg@debian.org>> a écrit :

    Hi Jérémy,

    On Wed, Aug 27, 2025 at 08:37:42AM +0200, Jérémy Lal wrote:
     > Le mar. 26 août 2025 à 17:21, Julian Gilbey <jdg@debian.org
    <mailto:jdg@debian.org>> a écrit :
     >
     >   Hi all,
     >
     >   I'm trying to build nbdime (my current attempt is at
     > https://salsa.debian.org/jdg/nbdime <https://salsa.debian.org/
    jdg/nbdime>).  I get lots of warnings from
     >   typescript because the source files it's searching for are not
     >   present; here is a sorted list of the warnings generated:
     > [...]
     >   Failed to parse source map from
     >   '/usr/share/nodejs/htmlparser2/src/Tokenizer.ts' file: Error:
    ENOENT: no such
     >   file or directory, open '/usr/share/nodejs/htmlparser2/src/
    Tokenizer.ts'
     >
     >   Is this a bug in these packages (eg node-htmlparser2), or is it
    fine
     >   to ignore them?
     >
     > These messages makes no sense, source maps exists when a file:
     > - has been compiled from typescript to javascript,
     > - has been compiled or bundled or minified from javascript to a
    (possibly) lower
     > javascript version
     > Debian packages may or may not install source maps.
     > If everything else works, you can safely ignore the warnings.
     > However it might be worth it to investigate if we want source
    maps in our
     > packages.

    Thanks for this analysis.  In node-htmlparser2, for example, we find
    files such as

    /usr/share/nodejs/htmlparser2/lib/Tokenizer.d.ts.map
    /usr/share/nodejs/htmlparser2/lib/Tokenizer.js.map
    /usr/share/nodejs/htmlparser2/lib/esm/Tokenizer.d.ts.map
    /usr/share/nodejs/htmlparser2/lib/esm/Tokenizer.js.map

    These refer to the sources being in ../src or ../../src respectively;
    these are not included in the Debian package.

    I don't have any view on whether we want source maps or even the
    sources in our packages.


Could anyone from the javascript team think about it ?

The upstream package is distributed as this (except that sourcemaps links points to raw.githubusercontent.com). This bug is fixed in 10.0.0



Reply to: