3box-comments-react icon indicating copy to clipboard operation
3box-comments-react copied to clipboard

crashes when currentUser3BoxProfile is cleared

Open dkent600 opened this issue 5 years ago • 8 comments

Using "3box-comments-react": "^3.0.1"

This line:

https://github.com/3box/3box-comments-react/blob/37862baca1f7075916a30d7b0fbc8c56c8506b55/src/components/Input.jsx#L179

is triggering this exception:

TypeError: Cannot read property 'image' of null instrument.ts:129 message:"Cannot read property 'image' of null" stack:"TypeError: Cannot read property 'image' of null at Input.render (webpack-internal:///./node_modules/3box-comments-react/lib/components/Input.js:331:58)

STEPS: I'm not sure if I have narrowed this down to the smallest possible conditions.

<ThreeBoxComments
            [irrelevant attributes]
            box={a 3Box instance}
            currentUserAddr={a valid account address}
            currentUser3BoxProfile={a valid 3Box user profile}
          />
<ThreeBoxComments
            [irrelevant attributes]
            box={undefined}
            currentUserAddr={undefined}
            currentUser3BoxProfile={undefined}
          />

RESULT: crash EXPECT: no crash

dkent600 avatar May 26 '20 15:05 dkent600

Any suggestions about this? It is blocking our (Alchemy) integration of your comments module. Is there a suggested work-around? Thanks!

dkent600 avatar Jun 08 '20 13:06 dkent600

Hey! Thanks for the detailed report and sorry for the slow response. Seems like this should be an easy fix. Can have a look at it tomorrow.

oed avatar Jun 08 '20 17:06 oed

Great, thanks!

dkent600 avatar Jun 08 '20 18:06 dkent600

I just published version 3.0.4. Try it out and see if it works!

oed avatar Jun 09 '20 07:06 oed

Will do, thanks!

dkent600 avatar Jun 09 '20 13:06 dkent600

@oed Still a crash, looks like when currentUserAddr is defined and currentUser3BoxProfile is not:

https://github.com/3box/3box-comments-react/blob/fcb9115193e64b8ecc1de79ba30bed556d4d1eb5/src/components/Input.jsx#L218

dkent600 avatar Jun 17 '20 16:06 dkent600

@dkent600 please let us know if this is working better with 3.0.5 :)

oed avatar Jun 18 '20 13:06 oed

Working better, but still seeing an issue in a similar scenario, though I haven't had a chance to confirm exactly what is going on:

index.js:33 Uncaught (in promise) TypeError: Cannot read property 'startsWith' of undefined

The exception is coming from here: https://connect.3box.io/v1/index.js

dkent600 avatar Jun 18 '20 16:06 dkent600