Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pdfjs-dist to v3.5 #944

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

make-github-pseudonymous-again
Copy link
Contributor

This is the first version of pdfjs-dist that fails because of SyntaxError: Unexpected token '||=':

I20240514-04:16:20.691(2)?   1) /imports/lib/pdf/pdf.tests.ts
I20240514-04:16:20.692(2)?        should work on the server:
I20240514-04:16:20.692(2)?      /home/runner/work/patients/patients/node_modules/pdfjs-dist/legacy/build/pdf.js:4907
I20240514-04:16:20.692(2)?     (intentState.renderTasks ||= new Set()).add(internalRenderTask);
I20240514-04:16:20.692(2)?                              ^^^
I20240514-04:16:20.693(2)? 
I20240514-04:16:20.693(2)? SyntaxError: Unexpected token '||='
I20240514-04:16:20.693(2)?       at wrapSafe (internal/modules/cjs/loader.js:1031:16)
I20240514-04:16:20.693(2)?       at Module._compile (internal/modules/cjs/loader.js:1080:27)
I20240514-04:16:20.693(2)?       at Module.Mp._compile (runtime.js:77:23)
I20240514-04:16:20.693(2)?       at Object.Module._extensions..js (runtime.js:105:23)
I20240514-04:16:20.694(2)?       at Module.load (internal/modules/cjs/loader.js:981:32)
I20240514-04:16:20.694(2)?       at Module.Mp.load (runtime.js:37:33)
I20240514-04:16:20.694(2)?       at Function.Module._load (internal/modules/cjs/loader.js:821:12)
I20240514-04:16:20.694(2)?       at Module.require (internal/modules/cjs/loader.js:1005:19)
I20240514-04:16:20.694(2)?       at require (internal/modules/cjs/helpers.js:107:18)
I20240514-04:16:20.694(2)?       at npmRequire (npm-require.js:111:12)
I20240514-04:16:20.694(2)?       at Module.useNode (packages/modules-runtime.js:751:18)
I20240514-04:16:20.694(2)?       at module (packages/modules.js:5156:8)
I20240514-04:16:20.694(2)?       at fileEvaluate (packages/modules-runtime.js:336:7)
I20240514-04:16:20.694(2)?       at Module.require (packages/modules-runtime.js:238:14)
I20240514-04:16:20.694(2)?       at Module.moduleLink [as link] (/home/runner/.meteor/packages/modules/.0.19.0.vw5cu9.x68za++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/@meteorjs/reify/lib/runtime/index.js:52:22)
I20240514-04:16:20.695(2)?       at getNamespace (packages/dynamic-import.js:630:10)
I20240514-04:16:20.695(2)?    => awaited here:
I20240514-04:16:20.695(2)?       at Function.Promise.await (/home/runner/.meteor/packages/promise/.0.12.2.qhmebw.8r9v9++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12)
I20240514-04:16:20.695(2)?       at imports/lib/pdf/pdf.ts:25:31
I20240514-04:16:20.695(2)?       at /home/runner/.meteor/packages/promise/.0.12.2.qhmebw.8r9v9++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
I20240514-04:16:20.695(2)?    => awaited here:
I20240514-04:16:20.695(2)?       at Function.Promise.await (/home/runner/.meteor/packages/promise/.0.12.2.qhmebw.8r9v9++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12)
I20240514-04:16:20.695(2)?       at imports/lib/pdf/pdf.tests.ts:16:3
I20240514-04:16:20.695(2)?       at /home/runner/.meteor/packages/promise/.0.12.2.qhmebw.8r9v9++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40

@make-github-pseudonymous-again make-github-pseudonymous-again added technology/pdf This has to do with leveraging the portable document format. dependencies Pull requests that update a dependency file deps This issue has to do with dependencies labels May 14, 2024
@make-github-pseudonymous-again
Copy link
Contributor Author

Should try to see if node module recompilation helps.

@make-github-pseudonymous-again
Copy link
Contributor Author

With recompilation enabled, it complains about private class methods:

Errors prevented bundling:
While building for os.linux.x86_64:
node_modules/pdfjs-dist/build/pdf.js:
/home/runner/work/patients/patients/node_modules/pdfjs-dist/build/pdf.js: Class
private methods are not enabled. Please add
`@babel/plugin-proposal-private-methods` to your configuration.
   1551 |     return success;
   1552 |   }
 > 1553 |   #tryCleanup(delayed = false) {
        |   ^
   1554 |     this.#abortDelayedCleanup();
   1555 |     if (!this.#pendingCleanup) {
   1556 |       return false;

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! patients@ build: `meteor build "../dist" "--directory" "--server-only" "--architecture" "os.linux.x86_64"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the patients@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2024-05-14T02_59_43_078Z-debug.log

@make-github-pseudonymous-again make-github-pseudonymous-again added needs-dependency-upgrade Solving this issue requires upgrading at least one dependency waiting-for-upstream This issues needs an update from upstream before it can be resolved. and removed needs-dependency-upgrade Solving this issue requires upgrading at least one dependency labels May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file deps This issue has to do with dependencies technology/pdf This has to do with leveraging the portable document format. waiting-for-upstream This issues needs an update from upstream before it can be resolved.
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant