-
Notifications
You must be signed in to change notification settings - Fork 96
weird behaviour when bundled #142
Comments
It seems that uglifyjs breaks that line when it has I managed to make an usable build(it connects by using wss now) by disabling that option but the overall bundle size increased 35%. |
@fsdiogo can you look into this one? |
Yes, I'll take a look. |
Hey @kenshyx, in your UglifyJS config try passing this option: compress: {
unused: false
} Check ipfs/js-ipfs#1321 and ipfs/aegir#214 for reference. |
Hey @fsdiogo , I've tried with that option, now I get the console full with this:
|
Hmm 🤔 is the project on GitHub so I can take a look? |
It is on github but in a private repo. This is the relevant webpack config part I'm using right now for staging build:
You can check the aplication here. If you leave the page opened for 5 minutes without doing anything that error starts to pop in console. |
What version of IPFS are you using? To allow mangling before version
|
I forgot to add that you need to disable the ipfs companion extension to have a local js-ipfs node started. |
This is a recording of the error https://ipfs.io/ipfs/QmQUgpoVYGjonxeUAimnyWPdzzsyLX7FGjBMJZbG8Dfb2F |
Looks like there is a fix incoming, check ipfs/js-ipfs#1379. |
Hmm this might not be related to production build because I managed to replicate it also in development. So there might be an issue with |
Yeah, we just came to the same conclusion at the same time 😄 |
@kenshyx can I close this issue? |
Yes, thank you for your assistance! |
No problem! 👌 |
If I'm starting my js-ipfs node with this config:
On my local development environment it will work as expected, by using
wss
when connecting to signalling-server.On production bundle(using webpack 4), it always tries to connect using
ws
...:I managed to find the problem on this line https://github.com/libp2p/js-libp2p-webrtc-star/blob/master/src/utils.js#L15 . On the production version it always returns
false
from this https://github.com/multiformats/js-multiaddr/blob/master/src/index.js#L416.Both versions(develop and prod) return the same codes for swarm multiaddress when
.protos()
is called` [55 6 478 275 421] => 55 is resolvable. Any ideas? :/The text was updated successfully, but these errors were encountered: