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

Angular 19 Compatibility issue #1166

Open
rcrafael opened this issue Dec 9, 2024 · 7 comments
Open

Angular 19 Compatibility issue #1166

rcrafael opened this issue Dec 9, 2024 · 7 comments

Comments

@rcrafael
Copy link

rcrafael commented Dec 9, 2024

After upgrading from Angular 18 to 19, I got issue in the ng2-pdf-viewer dependency PDFJS-DIST.
I already tried removing the caret(^) and downgrading this ng2-pdf-viewer from 10.4.0 to 10.2.2 (which is working in angular 18 previously) but still got the same error from the pdfjs-dist after serving the angular app.

anyone run into the same issue? or someone know the fix for this?

image

@dzonatan
Copy link

dzonatan commented Dec 9, 2024

it seems to be angular-cli fault: angular/angular-cli#29077
I see they're working on a patch already

@joewIST
Copy link

joewIST commented Dec 10, 2024

@rcrafael A workaround is to add the packages to the externalDependencies array in the build options, e.g.:
"externalDependencies": [ "http", "https", "url", "util", "fs" ]

@shamoon
Copy link
Contributor

shamoon commented Dec 10, 2024

I think this can be closed, the angular change above was merged and will presumably be released soon. The above only happens in certain situations I believe anyway.

Compatibility between Angular 18 and v10.4 of this package is covered in a separate issue already.

@rcrafael
Copy link
Author

rcrafael commented Dec 10, 2024

@rcrafael A workaround is to add the packages to the externalDependencies array in the build options, e.g.: "externalDependencies": [ "http", "https", "url", "util", "fs" ]

i have tried this workaround but i got different error after serving the application.
image

@dzonatan
Copy link

for the time being you can downgrade the @angular-devkit/build-angular to 19.0.3

@rcrafael
Copy link
Author

for the time being you can downgrade the @angular-devkit/build-angular to 19.0.3

actually, i ended up downgrading to angular 18, i will wait for the version 19 to be stable.

thank for the response

@ricardosaracino
Copy link

Angular 19 is working fine for me less all this

4:25:49 PM [vite] (client) warning: 
C:/Users/Ric/Projects/orbulis-portal/.angular/cache/19.1.4/orbulis-portal/vite/deps/ng2-pdf-viewer.js
12150|        const worker = yield import(
12151|          /*webpackIgnore: true*/
12152|          this.workerSrc
   |          ^^^^^^^^^^^^^^
12153|        );
12154|        return worker.WorkerMessageHandler;
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

  Plugin: vite:import-analysis
  File: C:/Users/Ric/Projects/orbulis-portal/.angular/cache/19.1.4/orbulis-portal/vite/deps/ng2-pdf-viewer.js?v=2ae645d4
4:25:49 PM [vite] (client) warning: 
C:/Users/Ric/Projects/orbulis-portal/.angular/cache/19.1.4/orbulis-portal/vite/deps/ng2-pdf-viewer.js
26456|        const sandbox = import(
26457|          /*webpackIgnore: true*/
26458|          sandboxBundleSrc
   |          ^^^^^^^^^^^^^^^^
26459|        );
26460|        sandbox.then((pdfjsSandbox) => {
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

  Plugin: vite:import-analysis
  File: C:/Users/Ric/Projects/orbulis-portal/.angular/cache/19.1.4/orbulis-portal/vite/deps/ng2-pdf-viewer.js?v=2ae645d4

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

No branches or pull requests

5 participants