yWorks/svg2pdf.js

Latest master doesn't build

olafure opened this issue · 1 comments

Describe the bug
Latest master commit (6b5b4ea) doesn't build.

Output:

src/svg2pdf.ts → dist/svg2pdf.umd.js, dist/svg2pdf.umd.min.js...
[!] (plugin typescript) Error: @rollup/plugin-typescript TS1005: ']' expected.
../../node_modules/@types/jest/index.d.ts (453:62)
453     type NonFunctionPropertyNames<T> = keyof { [K in keyof T as T[K] extends Func ? never : K]: T[K] };
Error: @rollup/plugin-typescript TS1005: ']' expected.
    at error (/local/data/projects/cutlist/local/svg2pdf.js/node_modules/rollup/dist/shared/rollup.js:198:30)

There's been 3 months since last commit (which failed, according to the workflow run).
The package lockfile isn't checked into the repo. Since all dependencies constantly change, this is probably caused by a patch release of a dependency that should have been a minor/major release.

I'd guess that typescript needs updating. I tried the most recent release but that produced different errors.

To Reproduce

git clone 'https://github.com/yWorks/svg2pdf.js.git'
cd svg2pdf.js
npm i 
npm npm run test:ci # This will produce the above error

I tried this with npm 10, 12 and 16 with same results. 10 and 12 are both used in the workflow files.

Expected behavior
Successful test

Screenshots
See output at top.

Desktop (please complete the following information):

  • OS: Debian 10
  • Browser: N/A
  • Version N/A

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser N/A
  • Version N/A

Thank you for the error report. Unfortunately, I was not able to reproduce this issue immediately, neither on my own machine nor with GitHub's CI.

Nonetheless, I committed a package-lock.json file so we might avoid similar errors in the future (a yarn.lock file was already present, so using yarn to install the dependencies should have worked for you as well, already). This resulted in a failed CI build with a similar, albeit slightly different error message:

src/svg2pdf.ts → dist/svg2pdf.umd.js, dist/svg2pdf.umd.min.js...
[!] (plugin typescript) Error: @rollup/plugin-typescript TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.
src/context/stylesheets.ts (15:16)

After bumping the node version to 16, everything worked fine again. So I think this was caused by an unfortunate combination of node/npm/dependency(/os?) versions.