Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

3box js is incompatible with Crisp (chat client) #699

Open
JasoonS opened this issue Jan 13, 2020 · 4 comments
Open

3box js is incompatible with Crisp (chat client) #699

JasoonS opened this issue Jan 13, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@JasoonS
Copy link

JasoonS commented Jan 13, 2020

Describe the bug
3box throws this error when running Box.openBox or Box.openSpace on a website that has the crisp client installed.

The exact error message that appears if crisp is used on the website is:

[ERROR] orbit-db: [Error: The object passed has circular references]

To Reproduce
Steps to reproduce the behavior:

  1. Load any app that uses 3box locally ( eg. https://github.com/3box/3box-dapp/ )
  2. Add the following to the index.html:
<script type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="0d093f8e-b90c-49d2-a514-c3189145045a";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
  1. Run the website (eg npm start)
  2. Try to login to a Box or a Space and open the browser console. You will not be able to login, and you will see the error.
  3. Try remove crisp and there will be no error, and everything will work as it is supposed to.

Expected behavior
3box should be unaffected by adding 3rd party additions such as crisp. (there must be some kind of side effect in crisp that causes the problem?)

Tested on Firefox & chrome Ubuntu 19.04.

Additional context
This isn't an issue with 3box but rather some internal dependencies of orbit-db and ultimately it calls: https://www.npmjs.com/package/is-circular and that returns false and throws the error.

I know this isn't probably a bug directly in 3box, but this is where the impact is. I hope someone in the team can bubble the issue up to where it can be fixed and that fix can be used downstream in 3box.

@oed
Copy link
Member

oed commented Jan 13, 2020

Looks like is-circular is a dependency for some things that js-ipfs uses. I think you're right about crisp having some sort of side effect. Any insight into what it could be doing would be helpful!

@oed oed added the bug Something isn't working label Jan 13, 2020
@JasoonS
Copy link
Author

JasoonS commented Jan 13, 2020

Thanks for taking a look! Unfortunately I don't have any more insight. :(

I'm integrating 3box into v2 of https://wildcards.world , so hopefully we can find a solution before we want to launch (or I'll need to find another chat client).

@oed
Copy link
Member

oed commented Jan 13, 2020

@JasoonS Do you know if the crisp client is open source? That would make things easier to debug. What timeline are you looking to release your v2 on?

Wildcards looks cool :)

@JasoonS
Copy link
Author

JasoonS commented Jan 13, 2020

Wildcards looks cool :)

Thanks 👍

Doesn't seem like it is opensource :/ They have lots of code, but none of them seem to be the frontend integration: https://github.com/crisp-im

We will hopefully launch v2 in about a month. It is a pretty big redo, we replacing drizzle+truffle with thegraph.com and adding 3box and a few new features mostly enabled by thegraph.

I'll take a look at some alternatives such as https://www.chatwoot.com/ (free+opensource) anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants