-
Notifications
You must be signed in to change notification settings - Fork 1.2k
TypeError: Cannot read property 'put' of undefined #1194
Comments
@barnendu could you please post the code you used for getting this error? |
Hi @barnendu. This error might be caused because the local repo/storage that ipfs uses hasn't been initialized. Does running something like There is a similar issue that was just opened that finds this to be the problem and a fix that @paulogr might start working on. #1180 |
@JonKrone thanks, I have mistakenly called ipfs.files.add(data, [options], [callback]) API out side the node.on('ready', () => {}) event . Now the issue has been fixed by calling add file api inside the on ready event. |
I faced the same situation, in order for me to solve it i deleted a file called repo.lock located in .jsipfs folder at the home directory |
@barnendu glad that you figured it out. Thanks for reporting anyway. |
Version: 0.27.7
Platform:
ProductName: windows 10
ProductVersion:
BuildVersion:
Type: Bug
Severity: Medium
Description:
Getting TypeError: Cannot read property 'put' of undefined
Steps to reproduce the error:
› node src/index.js
C:\Users\Raju\test-ipfs\node_modules\ipfs-block-service\src\index.js:64
this._repo.blocks.put(block, callback)
^
TypeError: Cannot read property 'put' of undefined
at BlockService.put (C:\Users\Raju\test-ipfs\node_modules\ipfs-block-service\src\index.js:64:23)
at waterfall (C:\Users\Raju\test-ipfs\node_modules\ipld-resolver\src\index.js:390:28)
at nextTask (C:\Users\Raju\test-ipfs\node_modules\ipld-resolver\node_modules\async\waterfall.js:16:14)
at next (C:\Users\Raju\test-ipfs\node_modules\ipld-resolver\node_modules\async\waterfall.js:23:9)
at C:\Users\Raju\test-ipfs\node_modules\ipld-resolver\node_modules\async\internal\onlyOnce.js:12:16
at Object.serialize (C:\Users\Raju\test-ipfs\node_modules\ipld-dag-pb\src\util.js:34:3)
at waterfall (C:\Users\Raju\test-ipfs\node_modules\ipld-resolver\src\index.js:389:22)
at nextTask (C:\Users\Raju\test-ipfs\node_modules\ipld-resolver\node_modules\async\waterfall.js:16:14)
at exports.default (C:\Users\Raju\test-ipfs\node_modules\ipld-resolver\node_modules\async\waterfall.js:26:5)
at IPLDResolver._put (C:\Users\Raju\test-ipfs\node_modules\ipld-resolver\src\index.js:388:5)
The text was updated successfully, but these errors were encountered: