Closed urgent closed 4 years ago
Oh wow. I think it's an error parsing dat.foundation
. Could you try out dat://beakerbrowser.com
to see if it works?
No, still no luck:
Gonna try to reproduce it on my end. Are you using the latest version of the SDK?
Oh dang! Thank you so much for bringing this up. I think I found the problem! :D
Could you try installing the latest version on master and seeing if it works?
npm i -s datproject/sdk
Awesome! :D
@RangerMauve I am still getting that file not found error.
I closed it while I tested on creating an archive of my own, think that would fix it like there were different files in a new archive, but no luck.
I'm just getting started with dat, and will debug this too on my side.
Ok, this might sound dumb. But try adding in a delay of like 3 seconds before doing a readdir. :P
It might just not be loading the data quickly enough.
I had a bunch of code in place to account for such a circumstance, but it looks like it still needs some work.
You can add something like this after the initial DatArchive.load()
call:
await new Promise((resolve) => setTimeout(resolve, 3000))
That'll wait for 3 seconds for it to sync up with peers.
I think I found something that'll help. I'll try releasing it tomorrow after doing a thorough regression test.
Yes that 3 second wait worked great. Thank you!
What I Wanted DatArchive.load and read file per https://github.com/datproject/sdk#apiexamples-promise
What I Did
index.js:
browserify -d index.js > test-bundle.js
index.html:
What I Got