-
Notifications
You must be signed in to change notification settings - Fork 4
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
require function is used in a way in which dependencies cannot be statically extracted #23
Comments
This solution worked for me: i changed the import statement like so:- EDIT@swissspidy ah sorry. its a bad solution The warning went away. but the heic to jpeg conversions were failing. its a no-go |
Supressing it for now since it obscures other important information in the console. Upstream issue, which currently doesn't have a workaround: catdad-experiments/libheif-js#23 Full error message: ⚠ ../../node_modules/libheif-js/libheif-wasm/libheif-bundle.js Critical dependency: require function is used in a way in which dependencies cannot be statically extracted Import trace for requested module: ../../node_modules/libheif-js/libheif-wasm/libheif-bundle.js ../../node_modules/libheif-js/wasm-bundle.js ../../node_modules/heic-decode/index.js ../../node_modules/heic-convert/index.js ./src/worker/convert.worker.ts ./src/utils/comlink/ComlinkConvertWorker.ts ./src/services/heic-convert/service.ts ... Refs: - https://stackoverflow.com/questions/38392697/webpack-umd-critical-dependency-cannot-be-statically-extracted
I am not all that familiar with this issue in particular -- it's been a while since I used webpack. One question I have is: this shows as a warning. Warnings don't typically fail the build? Is this failing in some way or just causing annoying noise? I am finding that there are ways to ignore known warnings causing me to think this is not actually a blocking problem / failure as much as just scary looking. Second question: I believe statically extracting dependencies has to do with treeshaking. Is that correct? This module can't really be slimmed down, since it doesn't include anything that is used. Finally, it seems a few folks have reported it. Does anyone have a repro? Sharing a minimal code sample that reproduces the issue is very helpful in getting an issue debugged. |
If it helps, I have this error with version ^1.17.1 but not with 1.10.0. I use the program very simply as a dependency of |
its not blocking anything. its just a noise in devtools console tab btw thankyou for your awesome work! i tried other different libs but failed miserably. But libheif-js works nicely |
Found the way to supress this critical dependency warninig: check it out here |
It appears that the issue can be reproduced simply by requiring it in webpack as follows. It seems that the issue lies in the part where crypto is being required. Although this is a warning and not an error, |
Webpack is emitting this warning when I
require( 'libheif-js/wasm-bundle' )
in my project.The contents of
wasm-bundle.js
:libheif-js/wasm-bundle.js
Line 1 in d583276
Not sure how this can be best addressed, I'd have to look into that, but I thought I'd share it here just in case in case anyone has ideas.
The text was updated successfully, but these errors were encountered: