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
Tricking webpack makes webpack spit out ugly warnings #742
Comments
We need webpack/webpack#8826 I have been asking the Webpack team for years to add a way to ignore require calls, but they have been unresponsive. |
There's nothing standard, that's the problem. |
I'm also not a Webpack fan, but you can configure webpack to ignore certain requires (e.g. 'electron') like this: module.exports = {
externals: ['zlib', 'electron']
} If you used the standard |
@atombrenner If Got is deep in the dependency-tree, people will not understand why they would suddenly get such a warning, and most don't even know about the It's just silly that we have to waste so much energy trying to "trick" Webpack. This is far from the first time I had to waste time on Webpack related things. |
We could try this trick instead: https://twitter.com/kamilogorek/status/1102272038411137025 |
@sindresorhus |
|
@IssueHunt has funded $40.00 to this issue.
|
@sindresorhus has rewarded $36.00 to @szmarczak. See it on IssueHunt
|
@sindresorhus ,I am using got 9.6.0 and am still getting the above warnings after I updated to openid-client's latest version. Perhaps a very noob question considering the issue is resolved. |
Got 9.6.0 doesn't use TypeScript. |
How does adding it to 'externals' solve it? |
Don't know as I don't use webpack, but you can try out |
Thank you but the original question relates to Webpack as well, and upgrading got didn't change anything. |
I doubt it's Got failure (I don't say it's not), can you try just loading |
If you use Got 9.6.0 then I don't think it's Got's fault because Got 9.6.0 does not use TypeScript at all. |
I am using another node module that in turn is using got. |
As I said, I did try the newest version as well. |
What would you like to discuss?
I use
got 9.6.0
withwebpack 4.29.6
and target a node application. Webpack throws this ugly warningThe reason for this is the following tricky code in request-as-event-emitter.js line 42
If I replace those lines with
and configure webpack to treat 'electron' as an external dependency everything is fine without warnings.
Maybe this hack was necessary once, but it would nice to use something more standard that works out of the box.
The text was updated successfully, but these errors were encountered: