Closed resession closed 1 year ago
I cannot replicate this.
Does this happen with LTS node? Do you have a more complete example?
I cannot replicate this.
Does this happen with LTS node? Do you have a more complete example?
i tried it with lts 18.16.0 and i get the exact same error/crash after 1 or 2 minutes. i am using the same example, straight from the documentation.
i'll try this on my windows system and see if i get the same error.
what version of node are you using?
i ran the same exact code i my windows system, i get the following error on windows 10, node 18.10.0 and 20.2.0
again running the same code, this is from the docs
https://ipfs.github.io/helia-unixfs/modules/_helia_unixfs.html
TypeError: Cannot read properties of undefined (reading 'put')
at persist (file:///D:/Proj/test/node_modules/ipfs-unixfs-importer/dist/src/utils/persist.js:10:22)
at async file:///D:/Proj/test/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/buffer-importer.js:31:29
on my ubuntu linux system, using both node LTS 18.16.0 and node v20.2.0.
if i use just new new FsBlockstore(),
by itself or new FsDatastore()
by itself like
const helia = await helias.createHelia({
blockstore: new FsBlockstore(require('path').join(__dirname, 'data'))
})
// or
const helia = await helias.createHelia({
datastore: new FsDatastore(require('path').join(__dirname, 'data'))
})
then i do not get the heap out of memory error anymore. it tried it for a few minutes by themselves and no error was thrown and it did not crash.
problem is if i use them together
const helia = await helias.createHelia({
blockstore: new FsBlockstore(require('path').join(__dirname, 'data')),
datastore: new FsDatastore(require('path').join(__dirname, 'data'))
})
then the heap out of memory error is thrown and it crashes under 2 minutes.
spoke too soon
using new FsBlockstore()
or new FsDatastore()
by itself works for a few minutes, longer, but still throws heap out of memory error and crashes
I've managed to replicate this, there is a fix in https://github.com/libp2p/js-libp2p/pull/1804 - thanks for your patience!
i am using ubuntu linux, using nodejs v20.1.0. i am running basic code from the helia/unixfs docs.
the script returns what it should, but the problem is that after a few minutes, the script crashes. the error says that it is out of memory.
this is rest of the error message.
am i doing something wrong here, or did i use the wrong options? any ideas would be great.