-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Webpack parser: {requireEnsure: false} not working #10253
Comments
What is the advantage of enabling that rule (since I don't think we enable it by default) and at which line does it go wrong? Is it in PDF.js source code or in generated bundle code? Please provide a bit more information and the contents of line 7873. |
I don't think that Webpack setting is compatible with the |
Closing since I also don't think there is anything we can really do here. |
It looks like This leads to any
I don't understand this well enough to know if there's a way to include the fallback code that doesn't trigger the warning, but since it seems reasonable to include a fallback, I'll open an issue on the |
I'm not sure, but it looks like a possible solution to the fallback code would be to publish PDF.js as es6 modules and use something like rollup to ship the fallback code separately #10317 |
I'm having trouble following the
@Snuffleupagus could you elaborate a bit on that? When will the fallback activate and how is the worker loaded in that case? What kind of environments are you referring to? Would it be possible to remove the fallback in favour of an error? |
I have the exact problem, get the exact error from a plugin that is based on pdf.js (vue-pdf). |
This would be excellent. This warning is super annoying in any CRA project. |
Is this never going to be fixed @timvandermeij? Just wondering if I should be waiting or moving. |
It hasn't become clear that this is really something that needs to be fixed on the PDF.js side, and if so, what the alternatives for If #10253 (comment) would address the issue, then that is already tracked in a separate issue. |
@timvandermeij Hi, this happened to me in a Vue.js setup and I tried all plugins I could find. They were all based on pdf.js, and I got the same error: |
For a temporary fix override the react-scripts rule. |
This is and issue with Webpack v4 when rule:
{
parser: { requireEnsure: false },
}
having this output:
WARNING in ./node_modules/pdfjs-dist/build/pdf.js 7873:6-13
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
The text was updated successfully, but these errors were encountered: