RangerMauve / hyper-sdk

Make your own hyper apps!
https://www.youtube.com/watch?v=HyHk4aImd_I&list=PL7sG5SCUNyeYx8wnfMOUpsh7rM_g0w_cu&index=20
MIT License
290 stars 46 forks source link

Uncaught TypeError: Cannot read property 'join' of undefined #10

Closed serapath closed 5 years ago

serapath commented 5 years ago

I'm doing const url = 'dat://c610858d82e4c9bc9585bb26fedb260c080ed24c6a05bcf3da9ad73a6917ac82/' const archive = Hyperdrive(url)

using version "dat-sdk": "^0.1.0"

getting the following error:

index.js:931 Uncaught TypeError: Cannot read property 'join' of undefined
    at Storage.metadata [as create] (index.js:931)
    at Storage.openKey (storage.js:224)
    at Storage.openKey (storage.js:223)
    at Feed._open (index.js:326)
    at open (index.js:138)
    at run (index.js:19)
    at Feed.thunk [as _ready] (index.js:13)
    at new Feed (index.js:117)
    at Feed (index.js:37)
    at new Hyperdrive (index.js:43)
metadata @ index.js:931
Storage.openKey @ storage.js:224
Storage.openKey @ storage.js:223
Feed._open @ index.js:326
open @ index.js:138
run @ index.js:19
thunk @ index.js:13
Feed @ index.js:117
Feed @ index.js:37
Hyperdrive @ index.js:43
Hyperdrive @ index.js:26
Hyperdrive @ index.js:80
334../moloch-demo.sol @ contracts.js:7
o @ _prelude.js:1
(anonymous) @ _prelude.js:1
338.bel @ makeCollectionArea.js:3
o @ _prelude.js:1
(anonymous) @ _prelude.js:1
341../svg.json @ paginationButtons.js:3
o @ _prelude.js:1
(anonymous) @ _prelude.js:1
342.bel @ search.js:5
o @ _prelude.js:1
(anonymous) @ _prelude.js:1
333.bel @ index.js:5
o @ _prelude.js:1
r @ _prelude.js:1
(anonymous) @ _prelude.js:1
stream.js:64 WebSocket connection to 'ws://localhost:3472/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
WebSocketStream @ stream.js:64
DiscoverySwarmStreamWebsocket @ index.js:161
DiscoverySwarmWeb @ index.js:50
module.exports @ index.js:196
Hyperdiscovery @ index.js:51
module.exports @ index.js:11
SDK @ index.js:24
334../moloch-demo.sol @ contracts.js:2
o @ _prelude.js:1
(anonymous) @ _prelude.js:1
338.bel @ makeCollectionArea.js:3
o @ _prelude.js:1
(anonymous) @ _prelude.js:1
341../svg.json @ paginationButtons.js:3
o @ _prelude.js:1
(anonymous) @ _prelude.js:1
342.bel @ search.js:5
o @ _prelude.js:1
(anonymous) @ _prelude.js:1
333.bel @ index.js:5
o @ _prelude.js:1
r @ _prelude.js:1
(anonymous) @ _prelude.js:1
events.js:164 Uncaught Error: Unhandled "error" event. ([object Event])
    at Duplexify.emit (events.js:164)
    at Duplexify._destroy (index.js:191)
    at index.js:182
    at Item.run (browser.js:153)
    at drainQueue (browser.js:123)
RangerMauve commented 5 years ago

What sort of build tools are you using? Browserify?

ninabreznik commented 5 years ago

Screenshot_2019-08-07_04-10-15

serapath commented 5 years ago

yes, browserify. see https://github.com/ethereum-play/smartcontract.codes

we refactored the code inside out and currently it looks like it all breaks when execution reaches:

const url = 'dat://c610858d82e4c9bc9585bb26fedb260c080ed24c6a05bcf3da9ad73a6917ac82/'

const archive = Hyperdrive(url)
serapath commented 5 years ago

some of our test users also got:

Could not connect to local gateway at ws://localhost:3472,
trying remote gateway at wss://discoveryswarm.mauve.moe.
This isn't an error unless you're trying to use a local gateway. 😁
DOMException: "The operation is insecure."

... i think we have quite a lot of users who try to open the page in incognito. Maybe there is way to store stuff in the browser, so maybe in that case - is it possible to throw an error that i can catch so then we can

RangerMauve commented 5 years ago

I'm not sure how to get that join error. I tried loading it in Chrome and Firefox and it seemed to be working. I tried in incognito mode as well. 🤔 Is the error causing code deployed to the website?

I think you'll need to add some code to detect when people are in incognito mode and add persist: false to the archive.

By the way this looks really cool! I love the color scheme and layout. 🤩

RangerMauve commented 5 years ago

I don't think this is an error with the gateway though. 🤔

RangerMauve commented 5 years ago

So, as we discussed on IRC, it seems to be an issue introduced in a fix I submitted to hyperdrive a week or so ago.

It fixed an issue on Windows, but introduce an issue on web since browserify's path implementation doesn't supply the path.posix property.

RangerMauve commented 5 years ago

This should be fixed in version 0.2.0 😁

ninabreznik commented 5 years ago

Is 0.2.0 out? We for now installed the verison of Hyperdrive you recommended and it works fine!

On Thu, Aug 8, 2019 at 8:55 PM RangerMauve notifications@github.com wrote:

This should be fixed in version 0.2.0 😁

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/datproject/sdk/issues/10?email_source=notifications&email_token=AAIGZS7XN3KUSTYAK4BPW73QDR22XA5CNFSM4IJRAD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD34XGXQ#issuecomment-519664478, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIGZSYDMVKNNXWSPZEU4GDQDR22XANCNFSM4IJRAD6A .

--


Nina Breznik, Vision Baker play.ethereum.org wizardamigos.com

Twitter: @ninabreznik

Telegram: +1 510 747 84 39 Gitter: gitter.im/ninabreznik

RangerMauve commented 5 years ago

Yeah! I just released it. 😁 It should work with the latest hyperdrive (9.16.0).

ninabreznik commented 5 years ago

Sweet. Will try to update and see how it behaves. Thanks :)

On Thu, Aug 8, 2019 at 9:21 PM RangerMauve notifications@github.com wrote:

Yeah! I just released it. 😁 It should work with the latest hyperdrive (9.16.0).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/datproject/sdk/issues/10?email_source=notifications&email_token=AAIGZS2HBUM5RFQHICRQGWTQDR54FA5CNFSM4IJRAD6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD34ZJ3Q#issuecomment-519673070, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIGZS47YJ5G25SS4LA2RCLQDR54FANCNFSM4IJRAD6A .

--


Nina Breznik, Vision Baker play.ethereum.org wizardamigos.com

Twitter: @ninabreznik

Telegram: +1 510 747 84 39 Gitter: gitter.im/ninabreznik