Hello,
since @material-ui/icons v2.0.1, I'm unable to install it using yarn (v1.9.2).
It just timeout after a while and multiple info There appears to be trouble with your network connection. Retrying...
messages.
Here is the error from yarn :
Trace:
Error: https://registry.yarnpkg.com/@material-ui/icons/-/icons-2.0.1.tgz: ESOCKETTIMEDOUT
at ClientRequest.<anonymous> (/usr/share/yarn/lib/cli.js:138043:19)
at Object.onceWrapper (events.js:273:13)
at ClientRequest.emit (events.js:182:13)
at TLSSocket.emitRequestTimeout (_http_client.js:652:40)
at Object.onceWrapper (events.js:273:13)
at TLSSocket.emit (events.js:182:13)
at TLSSocket.Socket._onTimeout (net.js:448:8)
at ontimeout (timers.js:424:11)
at tryOnTimeout (timers.js:288:5)
at listOnTimeout (timers.js:251:5)
EDIT : apparently it's a known issue : https://github.com/yarnpkg/yarn/issues/6221
@material-ui/icons
package is around ~40M. It's not that big, but it's definitely not small!
We could save 22M by removing the /es
folder. @b1f6c1c4 any objection? I know we added it into #10497 but it was before we went from 1k icons to 5k icons. With issues like #12422, I'm wondering if we shouldn't remove the index.js
too. Basically, forcing people to explicitly importing the icons they need. I suspect it's already what +80% of people are doing.
I found a solution here :
https://github.com/yarnpkg/yarn/issues/4890#issuecomment-348479446
So either install it using yarn add @material-ui/icons --network-timeout 500000
or create a .yarnrc
file inside your project with this content :
network-timeout 500000
I think reducing the package size to the minimum would be great. People can always go with a babel solution such as https://github.com/lodash/babel-plugin-lodash to rewrite the import.
@oliviertassinari What about separate @material-ui/icons-es
from @material-ui/icons
? Just like lodash-es
and lodash
.
Reason:
Thanks for the input. Let's not change a thing for now. Wait for more insight from our users.
@jgoux 's solution does seem to work. But as far as I understand everyone installing the icons will stumble over the problem. Shouldn't the installation section in the readme be extended by @jgoux 's solution?
Current yarn network timeout is 30s: https://github.com/yarnpkg/yarn/blob/15a438de996aac8b9eb08719a3f27ec03f650b21/src/constants.js#L36-L37. It should takes less than 30s to install this dependency!
What about separate聽@material-ui/icons-es聽from聽@material-ui/icons? Just like聽lodash-es聽and聽lodash.
@b1f6c1c4 I believe lodash did more harm than good to the community with the double package. It's a mess with transitive dependencies. People end-up loading the two versions.
I think that we should be removing the /es
folder if more people complain about the network issue. It might even be beneficial to people doing tree-shaking by doing a full path import instead. Isn't it slow right now? The index.js has 5k exports. Let's wait and see.
I have added the waiting for users upvotes
tag. Please upvote this issue if you are experiencing this issue and want us to work on it. We will prioritize our effort based on the number of upvotes.
@blixt wrong repository, go to: https://github.com/google/material-design-icons.
@oliviertassinari
I believe lodash did more harm than good to the community with the double package. It's a mess with transitive dependencies. People end-up loading the two versions.
Is that actually worse than if all the code is in one package and only half of your deps use the /es
modules? I can't think of how it's any worse
I'm getting the timeout on a Raspberry Pi but I'm still confused why it would be a problem since the tarball for material-ui-icons-4.2.1.tgz
is only 1.2M. Is yarn mistakenly including the unzip operation inside the timeout?
Not working for me as well, I guess I have to use a different lib
The size of the package has been going down over the last few releases: https://packagephobia.now.sh/result?p=@material-ui/icons.
Same Issue here.
Increasing the timeout does not work for me. Ill try 500 000 instead of 100 000 but I think it wont help. Also it does work when just doing a yarn install. But if I want to build my docker container, which already wroked countless times before with this container and library, it just does not work any more.... Some help would be greatly appreciated!
Same issue,
With yarn @material-ui/icons get stuck at 1067/1068, but with npm install it works.
Really strange...
EDIT
I manage to get it to work by upgrading yarn to the latest version (not sure if that was crucial) and use --network-timeout 500000
and just wait it out.
At least, we have made progress with the size of the package over the last few months: https://packagephobia.now.sh/result?p=%40material-ui%2Ficons
FYI - I just hit it as well after upgrading yarn.
An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.4.3.tgz: ESOCKETTIMEDOUT"
I'll try the .yarnrc
hack.
FontAwesome is a bit larger than us (+10%): https://packagephobia.now.sh/result?p=%40fortawesome%2Ffontawesome-free.
@oliviertassinari Interesting... Yes 9.60 MB is small enough TBH, given this is a lib with bunch of svg data. I'm pretty sure this is due to some blip in yarn or even my network traffic (even though it repro'ed multiple times consistently). I tried the network timeout hack and it works.
Also got this issue. npm install
fixed it for me
I'm getting the timeout on a Raspberry Pi but I'm still confused why it would be a problem since the tarball for
material-ui-icons-4.2.1.tgz
is only 1.2M. Is yarn mistakenly including the unzip operation inside the timeout?
That sounds very reasonable - I have this failure only on a low-end device. - The timeout increase helped, though.
Most helpful comment
I found a solution here :
https://github.com/yarnpkg/yarn/issues/4890#issuecomment-348479446
So either install it using
yarn add @material-ui/icons --network-timeout 500000
or create a.yarnrc
file inside your project with this content :I think reducing the package size to the minimum would be great. People can always go with a babel solution such as https://github.com/lodash/babel-plugin-lodash to rewrite the import.