question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning in angular v11

See original GitHub issue

Although the application compiles and works just fine. There is a warning while building angular 11 application.

Warning: Entry point 'ng2-pdf-viewer' contains deep imports into '/Users/[project path]/node_modules/pdfjs-dist/es5/build/pdf', '/Users/[project path]/node_modules/pdfjs-dist/es5/web/pdf_viewer'. This is probably not a problem, but may cause the compilation of entry points to be out of order.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
arturovtcommented, May 20, 2021

This is only a warning, which happens because of how Mozilla ships the pdfjs-dist package.

You can create an ngcc.config.js file on the root level:

- src
  - main.ts
 - package.json
 - ngcc.config.js

And its content should be as follows:

module.exports = {
  packages: {
    'ng2-pdf-viewer': {
      ignorableDeepImportMatchers: [/pdfjs-dist/],
    },
  },
};

Note that this is the recommended way advised by the Angular CLI team, but I can’t guarantee that it will work in all your applications, and I can’t know why it wouldn’t work… At least it works in mine 😃

0reactions
jeslovecommented, Sep 2, 2021

This is only a warning, which happens because of how Mozilla ships the pdfjs-dist package.

You can create an ngcc.config.js file on the root level:

- src
  - main.ts
 - package.json
 - ngcc.config.js

And its content should be as follows:

module.exports = {
  packages: {
    'ng2-pdf-viewer': {
      ignorableDeepImportMatchers: [/pdfjs-dist/],
    },
  },
};

Note that this is the recommended way advised by the Angular CLI team, but I can’t guarantee that it will work in all your applications, and I can’t know why it wouldn’t work… At least it works in mine 😃

This end up working for me too Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 11 any/undefined types warnings - Stack Overflow
I upgraded my app from Angular v10 to v11 and now I get multiple errors and warnings because some (maybe all) fields can...
Read more >
Deprecated APIs and features - Angular
Deprecated features that can be removed in v11 or laterlink ... By default, when you use this pattern, you get a deprecation warning...
Read more >
Angular Version 11 Is Out! - JavaScript in Plain English
When creating new projects using a version of Angular CLI earlier than v11 you might get an error associated with the deprecation of...
Read more >
Comparison Between Angular 11 vs Angular 12 vs Angular 13
The Angular v11 of Google-developed web framework is a production ... another deprecation warning message as another Angular 12 element ...
Read more >
To disable this warning use "ng config -g cli ... - You.com
Your global Angular CLI version (14.0.3) is greater than your local version (10.2.1). The local Angular CLI version is used. To disable this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found