Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

LibP2P code breaks Pubsub when compiled #1417

Closed
eolszewski opened this issue Jul 2, 2018 · 2 comments
Closed

LibP2P code breaks Pubsub when compiled #1417

eolszewski opened this issue Jul 2, 2018 · 2 comments

Comments

@eolszewski
Copy link

Version:
ipfs@0.29.3

Platform:
Darwin Kernel Version 15.4.0

Type:

Bug

Severity:

High

Description:

Running locally works fine, but once you compile and minify, you get the following error:

main.e96fd1dc.js:149 Uncaught (in promise) Error: Callback was already called.
    at main.e96fd1dc.js:149
    at main.e96fd1dc.js:182
    at s (main.e96fd1dc.js:155)
    at main.e96fd1dc.js:182
    at main.e96fd1dc.js:155
    at l (main.e96fd1dc.js:155)
    at main.e96fd1dc.js:149
    at main.e96fd1dc.js:182
    at e.then.e (main.e96fd1dc.js:155)

Which I attribute to the following: libp2p/js-libp2p-secio#100

Steps to reproduce the error:

I'm still working out exactly how to reproduce this with the build process in a standalone repository, but this repository should suit the needs here while I work that out.
https://github.com/eolszewski/ipfs-pubsub-chatroom/blob/master/package.json

@eolszewski
Copy link
Author

@diasdavid here a branch that will allow you to reproduce this.

https://github.com/eolszewski/ipfs-pubsub-chatroom/tree/feature/webpack

If you clone this and run:

npm run build
npm run start

and then open your browser, you will notice no errors.

However, if you run:

npm run node:build
yarn global add serve
serve -s build

And then open your browser you will see the error mentioned above.
Uncaught (in promise) Error: Callback was already called.

@eolszewski
Copy link
Author

This was solved by adding the following to uglifyOptions:
compress: { unused: false }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant