Skip to content

Conversation

@shamoon
Copy link
Contributor

@shamoon shamoon commented Dec 4, 2024

See #1137 (comment)

No issues as far as I can tell:

 Browser application bundle generation complete.
03 12 2024 16:54:53.311:WARN [karma]: No captured browser, open http://localhost:9876/
03 12 2024 16:54:53.456:INFO [karma-server]: Karma v6.4.2 server started at http://localhost:9876/
03 12 2024 16:54:53.456:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
03 12 2024 16:54:53.459:INFO [launcher]: Starting browser Chrome
03 12 2024 16:55:01.185:INFO [Chrome 131.0.0.0 (Mac OS 10.15.7)]: Connected on socket z3lfWNlSE2EVxX4oAAAB with id 40205427
Chrome 131.0.0.0 (Mac OS 10.15.7): Executed 15 of 15 SUCCESS (0.117 secs / 0.108 secs)
TOTAL: 15 SUCCESS
Screenshot 2024-12-03 at 4 56 55 PM

Closes #1164

@VadimDez
Copy link
Owner

VadimDez commented Dec 4, 2024

Any idea how we could do it without adding Angular >= 19 and Angular <19?

@shamoon
Copy link
Contributor Author

shamoon commented Dec 4, 2024

Honestly, Im not sure if theres an easy way to e.g. polyfill it, agree that would be better.

@shamoon
Copy link
Contributor Author

shamoon commented Dec 6, 2024

Well, one workaround is, in the project that will use ng2-pdf-viewer is:

  1. Add e.g. "typings": "./src/typings.d.ts" to your package.json file
  2. Create the file src/typings.d.ts containing only: type SetIterator<T> = Iterator<T>;

I'm not 100% sure how, or even if, this could be done at the ng2-pdf-viewer level, I think maybe it cant be.

Again, alternative would be to downgrade pdfjs here, but feels like putting off the inevitable, unless theres some alternative solution out there, which is entirely possible!

@shamoon shamoon force-pushed the bump-angular-requirement branch from 0a2342f to ca225ad Compare December 6, 2024 01:08
@shamoon
Copy link
Contributor Author

shamoon commented Dec 6, 2024

Ps. I can include that workaround in the docs in the PR if that matters.

Anyway, enough from me, your call, sorry again for the hassle!

@medbenmakhlouf
Copy link

@shamoon , I got this error when I update to @angular/cli from "19.0.3" to "19.0.4" , I am not sure if this new error or it is cli's fault
Screenshot 2024-12-06 at 11 27 41

@shamoon
Copy link
Contributor Author

shamoon commented Dec 6, 2024

@shamoon , I got this error when I update to @angular/cli from "19.0.3" to "19.0.4" , I am not sure if this new error or it is cli's fault

Are you testing this PR or is that regarding the current version of the package? If the latter, I dont know why you would be commenting here, perhaps do so elsewhere.

This PR has no issue with 19.0.4:

ng2-pdf-viewer ng update @angular/cli @angular/core @angular/material
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 19.0.4 to perform the update.
Using package manager: npm
Collecting installed dependencies...
Found 34 dependencies.
Fetching dependency metadata from registry...
                  Package "@angular/material" has a missing peer dependency of "@angular/cdk" @ "19.0.2".
    Updating package.json with dependency @angular-devkit/build-angular @ "19.0.4" (was "19.0.2")...
    Updating package.json with dependency @angular/animations @ "19.0.3" (was "19.0.1")...
    Updating package.json with dependency @angular/cli @ "19.0.4" (was "19.0.2")...
    Updating package.json with dependency @angular/common @ "19.0.3" (was "19.0.1")...
    Updating package.json with dependency @angular/compiler @ "19.0.3" (was "19.0.1")...
    Updating package.json with dependency @angular/compiler-cli @ "19.0.3" (was "19.0.1")...
    Updating package.json with dependency @angular/core @ "19.0.3" (was "19.0.1")...
    Updating package.json with dependency @angular/forms @ "19.0.3" (was "19.0.1")...
    Updating package.json with dependency @angular/language-service @ "19.0.3" (was "19.0.1")...
    Updating package.json with dependency @angular/material @ "19.0.2" (was "19.0.1")...
    Updating package.json with dependency @angular/platform-browser @ "19.0.3" (was "19.0.1")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "19.0.3" (was "19.0.1")...
    Updating package.json with dependency @angular/router @ "19.0.3" (was "19.0.1")...
UPDATE package.json (2458 bytes)
✔ Cleaning node modules directory
✔ Installing packages
ng2-pdf-viewer % ng serve                                              
✔ Browser application bundle generation complete.

Initial chunk files   | Names         |  Raw size
vendor.js             | vendor        |   5.57 MB | 
polyfills.js          | polyfills     | 361.90 kB | 
styles.css, styles.js | styles        | 336.67 kB | 
main.js               | main          | 168.14 kB | 
runtime.js            | runtime       |   6.68 kB | 

                      | Initial total |   6.44 MB

Build at: 2024-12-06T14:41:32.830Z - Hash: df922c8ed5c8fc84 - Time: 5764ms

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **


✔ Compiled successfully.
Screenshot 2024-12-06 at 6 37 25 AM

@userhv
Copy link

userhv commented Dec 6, 2024

@shamoon , I got this error when I update to @angular/cli from "19.0.3" to "19.0.4" , I am not sure if this new error or it is cli's fault Screenshot 2024-12-06 at 11 27 41

Any correction for this?

@shamoon
Copy link
Contributor Author

shamoon commented Dec 6, 2024

Any correction for this?

A bit of a frustrating question. Did you read the comment above?

@userhv
Copy link

userhv commented Dec 6, 2024

Any correction for this?

A bit of a frustrating question. Did you read the comment above?

ng2-pdf-viewer 10.4.0 and angular 19.0.4 not working.
ng2-pdf-viewer 10.4.0 and angular 19.1.0-next.0 works

@shamoon
Copy link
Contributor Author

shamoon commented Dec 6, 2024

ng2-pdf-viewer 10.4.0 and angular 19.0.4 not working.
ng2-pdf-viewer 10.4.0 and angular 19.1.0-next.0 works

Again, if you are talking about 10.4, which is an existing released version of this package, I dont think the comments belong in this thread, it is just confusing. Anyway, it sounds like the resolution will be to upgrade Angular...

Edit: also, 10.4 with angular-cli 19.0.4: https://stackblitz.com/edit/stackblitz-starters-ytv3k6cd

@JeevanMahesha
Copy link

@shamoon / @VadimDez Any update regarding merging this PR???

@stale
Copy link

stale bot commented Jun 27, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 27, 2025
@shamoon
Copy link
Contributor Author

shamoon commented Jul 2, 2025

@shamoon / @VadimDez Any update regarding merging this PR???

The maintainer seems to only attend to the project intermittently, I dont have any control over that. Anyway, the package is working fine in Angular 19 and now 20 for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pdfjs-dist dependancy issue for setIterator

5 participants