react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Module not found: Package path ./lib/zlib/zstream.js is not exported from package

Open markcnunes opened this issue 1 year ago • 0 comments

First of all, thanks for providing the react-pdf package!

Describe the bug When navigating to a page that uses react-pdf, an error occurs: "Failed to compile - module not found." This issue occurs simply by adding the @flatfile/react dependency, even before including any code related to @flatfile/react. You will see in the example that I only added the dependency and did not use it in the code. The error disappears upon removing the @flatfile/react dependency. Other pages without react-pdf work fine.

I am not sure if I am missing something. I tried a few things I saw on other issues such as adding serverComponentsExternalPackages: ["@react-pdf/renderer"] to the next.config.js or importing the PDFViewer with next/dynamic but nothing seems to work.

To Reproduce

  1. Go to https://codesandbox.io/p/devbox/brave-chandrasekhar-9w2df3
  2. See error Package path ./lib/zlib/zstream.js is not exported from package

Expected behavior The page containing react-pdf should compile and render without any errors, even with the @flatfile/react dependency included.

Screenshots image

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
"@react-pdf/renderer": "^3.4.4",
"@flatfile/react": "^7.9.9",

It seems odd that adding @flatfile/react could cause this issue with react-pdf. Let me know if I should raise this issue with @flatfile/react instead.

markcnunes avatar Jun 17 '24 15:06 markcnunes