dat-js
dat-js copied to clipboard
TypeError: path is undefined
I followed the example on https://docs.dat.foundation/docs/browser-intro but i get TypeError: path is undefined
, using this code:
var dat = new Dat()
var archive = dat.create({
persist: true
})
archive.writeFile('/example.txt', 'Hello World!', () => {
localStorage.setItem('My_Repo', archive.url)
})
Removing .posix
in hyperdrive seemed to do the trick but I'm not sure if anything else needs to be updated as well.
Pushed the wrong button ^^ Guessing most of the work is put into dat-sdk now? Maybe the examples on the dat web needs to be updated?
I think this just needed a small bump in the version of hyperdrive that's being used. Maybe check out the version that the SDK uses? Sadly, nobody has had time to update the docs. 😅 I'll try to prioritize it after getting some other stuff done.
A PR fixing this issue would be very much appreciated by the way.
There seems to be something more than just bumping hyperdrive as 9.16.0, same as the sdk, as it still throws the undefined path. Im on ubuntu 18.04 running firefox 71.
Also the testing framework used zuul hasn't been maintained for two years and is throwing a lot of errors so ill add another issue for that.
@rangermauve, is it true that dat-js is becoming obsolete as we are opting for the SDK? If so, @mathiversen you might want to try the dat-sdk module. It still needs a small bit work but it's currently feature-parity.
Yeah, I'd say that dat-js is getting deprecated for dat-sdk. Same with dat-node. Part of the reason this hasn't been done more aggressively was that I was unsure about what Dat2 would look like.
But I can safely say that using the SDK would be more convenient (if the examples in the repo are enough to get you started)