-
Notifications
You must be signed in to change notification settings - Fork 538
error using browser bundle on constructor.name #291
Copy link
Copy link
Closed
Labels
P1High: Likely tackled by core team if no one steps upHigh: Likely tackled by core team if no one steps upexp/noviceSomeone with a little familiarity can pick upSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)
Metadata
Metadata
Assignees
Labels
P1High: Likely tackled by core team if no one steps upHigh: Likely tackled by core team if no one steps upexp/noviceSomeone with a little familiarity can pick upSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)
Type
Fields
Give feedbackNo fields configured for issues without a type.
Type: Bug
Severity: High
Description:
I found this error testing the experimental aegir build, still don't know why this happens, minified and un-minified bundles give the same error so it isn't terser (the new uglify) might be babel changing constructor name needs further investigation.
Still using constructor.name should be avoided reference below.
Reference:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#JavaScript_compressors_and_minifiers
Using a minified bundle this line https://github.com/libp2p/js-libp2p/blob/master/src/index.js#L362 gives an error
Uncaught Error: There is already a transport with this key
at TransportManager.add (transport.js:37)
at index.js:362
at parallel.js:31
at replenish (eachOfLimit.js:66)
at iterateeCallback (eachOfLimit.js:50)
at onlyOnce.js:12
at Switch. (parallel.js:36)
at Switch.g (events.js:165)
at Switch.EventEmitter.emit (events.js:78)
at EventEmitter. (index.js:109)
Steps to reproduce the error:
https://codesandbox.io/s/github/hugomrdias/ipfs-hd/tree/chore/test-example-codesandbox/examples/exchange-files-in-browser
in the index.html at the bottom change this line
<script src="https://unpkg.com/ipfs-hd@next"></script>to
<script src="https://unpkg.com/ipfs-hd/dist/ipfs.js"></script> for un minified sourceor
<script src="https://unpkg.com/ipfs/dist/index.js"></script> for the current ipfs bundle which works