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
util should be added to dependencies #3501
Comments
same issue here. |
Here is a tiny repo that demonstrates the issue: https://github.com/appzuka/webpack5-aws-sdk There was no issue with webpack4 because util was a dependency of webpack4. |
Hey @appzuka thanks for putting up that repo, I ran the code but I didn't see any errors just warnings Info
Can I get more informati0on on what error you see? |
HI @ajredniwja, Thanks for taking a look. Here is the error I see when I run
Click to see the full output:
If you check the line with the error you will see that the code does indeed depend on the util package: aws-sdk-js/lib/event_listeners.js Line 572 in 3ccfd94
If I manually add util by aws-sdk clearly uses util so I believe it should be listed as a dependency in package.json. |
I am not adding the package. Can run more tests. |
Workaround for webpack@5: npm i util webpack.config.js module.exports = {
// Other options...
resolve: {
fallback: {
"util": require.resolve("util/"),
},
}
} |
I believe the only workaround necessary is to install util. You should not also need the resolve-fallback. I'm not sure why util has not been added as a dependency. It is clearly used by aws-sdk-js so it should be there. The issue was masked because util was a dependency of webpack4 but it was been removed in webpack 5, which is why this is now an issue. |
With Node 14 you'll have the error |
Curious about the progress of this issue. Are there any PRs with fixes or updates? The issue was created almost a year ago and still hasn't been fixed. |
This is still broken. |
Still an issue as of Feb 1, 2022 |
Still an issue as of Mar 15,2022 |
Still an issue as of Apr 9, 2022 |
Still an issue as of May 2, 2022 |
Still an issue as of May 4, 2022 |
Still an issue as of May 6, 2022 |
Still an issue as of June 20, 2022 |
this solution works good |
Fixed in #4148 which was released in v2.1174.0 |
util is a dependency of the library but is not listed in package.json. For example, it is in event_listeners.js:
aws-sdk-js/lib/event_listeners.js
Line 572 in c9d32cf
Building with webpack v4 this was not an issue as util was also a dependency of webpack. In webpack v5 util is no longer a dependency so builds will fail unless it is included by other modules.
The text was updated successfully, but these errors were encountered: