Error: Module not found: Error: Can't resolve 'canvas' in 'path/to/node_modules/pdfjs-dist/es5/build'

See original GitHub issue

Hi great library to work with, I am facing the following issue with the latest version of ng2-pdf-viewer which 7.0.1 while creating the build by using the command npm run build:ssr.

./node_modules/pdfjs-dist/es5/build/pdf.js:14174:21-38 - Error: Module not found: Error: Can't resolve 'canvas' in '/path/to/node_modules/pdfjs-dist/es5/build''

It was working fine with the previous version 6.4.1.

I am working with angular 11.

Any suggestion of even a place to look to achieve the desired results? Regards,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:22
  • Comments:20

github_iconTop GitHub Comments

11reactions
predycsoftcommented, Oct 12, 2021

I finally found a solution! however it has been a long path. you can write me and I will help you directly! my email: guillermoalexandermoran@gmail.com

9reactions
tayambamwanzacommented, Jun 7, 2021

Same Problem for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
Description When building my Next JS application I get this error: ModuleNotFoundError: Module not found: Error: Can't resolve 'canvas' in ...
Read more >
Module not found: Error: Can't resolve 'path' - node.js
I'm running in the same problem. I fixed the "stream" error using a tsconfig.json path to readable-stream, but can't figure out a solution...
Read more >
Nextjs deploy error after installing remark-prism package
After installing remark-prism, I get this deploy error: ModuleNotFoundError: Module not found: Error: Can't resolve 'canvas' in ...
Read more >
module not found error | can not resolve react dom module
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera ...
Read more >
Webpack and Jest v0.36 Upgrade Guide
And these are the errors I'm getting. Compiled with problems: Error: Module not found: Error: Can't resolve 'net' in ...
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