[Pkg-javascript-devel] It looks like node-rollup-plugin-typescript and ts-node have issues

Julien Puydt julien.puydt at gmail.com
Tue Dec 14 06:57:36 GMT 2021


Hi,

I wanted to update node-typescript from 4.5.2 to 4.5.3.

As usual, I test my new package on a few rdeps before uploading. This
time I saw it broke ts-node and node-rollup-plugin-typescript. The
problem is that when I reverted to 4.5.2, I got the same failures... so
the new package might not be to blame.


For node-rollup-plugin-typescript, the build itself is broken:



+ rollup -c

src/index.js → dist/rollup-plugin-typescript.cjs.js, dist/rollup-
plugin-typescript.es.js...
(!) Entry module "src/index.js" is implicitly using "default" export
mode, which means for CommonJS output that its default export is
assigned to "module.exports". For many tools, such CommonJS output will
not be interchangeable with the original ES module. If this is
intended, explicitly set "output.exports" to either "auto" or
"default", otherwise you might want to consider changing the signature
of "src/index.js" to use named exports only.
https://rollupjs.org/guide/en/#outputexports
src/index.js
created dist/rollup-plugin-typescript.cjs.js, dist/rollup-plugin-
typescript.es.js in 46ms
# Step 1: build a temporary @rollup/plugin-typescript
cd packages/typescript && \
        ln -s ../../../node_modules/@types/resolve node_modules/ && \
        mkdir dist && \
        NODE_PATH=node_modules tsc --module CommonJS --esModuleInterop
src/index.ts
src/watchProgram.ts:43:5 - error TS2322: Type 'Promise<unknown>' is not
assignable to type 'Promise<boolean | void>'.
  Type 'unknown' is not assignable to type 'boolean | void'.
    Type 'unknown' is not assignable to type 'void'.

43     promise = Promise.race<Promise<boolean>>([
       ~~~~~~~

src/watchProgram.ts:43:46 - error TS2345: Argument of type
'Promise<unknown>[]' is not assignable to parameter of type
'Iterable<Promise<boolean> | PromiseLike<Promise<boolean>>>'.
  The types returned by '[Symbol.iterator]().next(...)' are
incompatible between these types.
    Type 'IteratorResult<Promise<unknown>, any>' is not assignable to
type 'IteratorResult<Promise<boolean> | PromiseLike<Promise<boolean>>,
any>'.
      Type 'IteratorYieldResult<Promise<unknown>>' is not assignable to
type 'IteratorResult<Promise<boolean> | PromiseLike<Promise<boolean>>,
any>'.
        Type 'IteratorYieldResult<Promise<unknown>>' is not assignable
to type 'IteratorYieldResult<Promise<boolean> |
PromiseLike<Promise<boolean>>>'.
          Type 'Promise<unknown>' is not assignable to type
'Promise<boolean> | PromiseLike<Promise<boolean>>'.
            Type 'Promise<unknown>' is not assignable to type
'Promise<boolean>'.
              Type 'unknown' is not assignable to type 'boolean'.

43     promise = Promise.race<Promise<boolean>>([
                                                ~
44       new Promise((r) => setTimeout(r, timeout, true)),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45       new Promise((r) => (resolve = r))
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46     ]);
   ~~~~~


Found 2 errors.

make[1]: *** [debian/rules:25: override_dh_auto_build] Error 2




and for ts-node, it is autopkgtest:


# Searching module in /usr/lib/nodejs/ts-node
# Searching module in /usr/lib/*/nodejs/ts-node
# Searching module in /usr/share/nodejs/ts-node
# Found /usr/share/nodejs/ts-node
# Searching files to link in /usr/share/nodejs/ts-node
'./dist' -> '/usr/share/nodejs/ts-node/dist'
'./dist-raw' -> '/usr/share/nodejs/ts-node/dist-raw'
'./esm' -> '/usr/share/nodejs/ts-node/esm'
'./esm.mjs' -> '/usr/share/nodejs/ts-node/esm.mjs'
'./package.json' -> '/usr/share/nodejs/ts-node/package.json'
'./register' -> '/usr/share/nodejs/ts-node/register'
# Launch debian/tests/pkg-js/test with sh -ex
+ test ! -e node_modules/util.promisify
+ mkdir -p tests/node_modules/.bin node_modules
+ test -L dist
+ rm -f dist
+ cp -r /usr/share/nodejs/ts-node/dist .
+ ln -s ../../../dist/bin.js tests/node_modules/.bin/ts-node
ln: failed to create symbolic link 'tests/node_modules/.bin/ts-node':
File exists
autopkgtest [07:48:41]: test pkg-js-autopkgtest: ----------------------
-]
autopkgtest [07:48:41]: test pkg-js-autopkgtest:  - - - - - - - - - -
results - - - - - - - - - -
pkg-js-autopkgtest   FAIL non-zero exit status 1




I write to the ml instead of opening direct bug reports because the
build logs of both these packages are clean, they migrated to testing
successfully, so both instances might be a change (hopefully 'a change'
and not 'changes'...) somewhere else triggering issues down the line,
so more information is needed to find out where exactly things are
broken.

Cheers,

J.Puydt



More information about the Pkg-javascript-devel mailing list