You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.
(node:28545) UnhandledPromiseRejectionWarning: TypeError: skynet.uploadFile is not a function
at /Users/ls/code/src/ltfschoen/skyhandler/scripts/skynetUpload.js:5:34
at Object.<anonymous> (/Users/ls/code/src/ltfschoen/skyhandler/scripts/skynetUpload.js:10:3)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
It appears to be because the code in the version that gets installed in node_modules/@nebulous/skynet on my local machine differs from the latest 'master' branch Github at https://github.com/NebulousLabs/nodejs-skynet (I assumed that was the version that's published to NPM, and I noticed that there aren't any official releases https://github.com/NebulousLabs/nodejs-skynet/releases).
If I inspect the code that gets installed to node_modules/@nebulous/skynet, it's clear that the error is caused because it's exporting capitalized UploadFile (I think triggered from this commit ~5 months ago 9e25320) instead of uploadFile that's used in the 'master' branch here https://github.com/NebulousLabs/nodejs-skynet/blob/master/src/upload.js#L20, and that code doesn't fallback to default values if the user doesn't provide all the necessary custom options as an argument to the uploadFile function (changes were made to improve this in the latest 'master'.
I was able to get it to work if modified package.json to just install the latest version from the 'master' branch (instead of it being "@nebulous/skynet": "^1.0.1", when installed using yarn add @nebulous/skynet:
I've tried this with both Node.js 14.7.0 and v12.18.3 and both encounter the same error.
The README says to refer to the docs here https://github.com/NebulousLabs/nodejs-skynet#documentation
I added the dependency by running
yarn add @nebulous/skynet
https://github.com/NebulousLabs/nodejs-skynet#installing, but it appears to install an older version from ~5 months ago into node_modules/, even though the version shown in the package.json in node_modules/ is 1.0.1 (the same as in the latest 'master'). And the latest documentation uses the latest code from the 'master' branch instead of the latest code published at NPM.If I even just try the example code at "Making Your First API Call" https://nebulouslabs.github.io/skynet-docs/?javascript#making-your-first-api-call, I get the following error:
It appears to be because the code in the version that gets installed in node_modules/@nebulous/skynet on my local machine differs from the latest 'master' branch Github at https://github.com/NebulousLabs/nodejs-skynet (I assumed that was the version that's published to NPM, and I noticed that there aren't any official releases https://github.com/NebulousLabs/nodejs-skynet/releases).
If I inspect the code that gets installed to node_modules/@nebulous/skynet, it's clear that the error is caused because it's exporting capitalized
UploadFile
(I think triggered from this commit ~5 months ago 9e25320) instead ofuploadFile
that's used in the 'master' branch here https://github.com/NebulousLabs/nodejs-skynet/blob/master/src/upload.js#L20, and that code doesn't fallback to default values if the user doesn't provide all the necessary custom options as an argument to theuploadFile
function (changes were made to improve this in the latest 'master'.Also, I noticed in the latest 'master' branch that if the user doesn't provide a
portalUrl
property value as part of thecustomOptions
parameter when callinguploadFile
, it doesn't appear to fallback to a default valuehttps://github.com/NebulousLabs/nodejs-skynet/blob/master/src/upload.js#L28
I was able to get it to work if modified package.json to just install the latest version from the 'master' branch (instead of it being
"@nebulous/skynet": "^1.0.1",
when installed usingyarn add @nebulous/skynet
:The text was updated successfully, but these errors were encountered: