We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following instructions https://web3.storage/docs/ to store a file
import * as Client from '@web3-storage/w3up-client' import { filesFromPaths } from 'files-from-path' const client = await Client.create() const files = await filesFromPaths(['/Users/test/w3up/example.json']) client.uploadFile(files).then((did) => console.log(did))
but getting these errors
learnyouw3up verify ex3.mjs Verifying /Users/test/w3up/ex3.mjs... file:///Users/test/.nvm/versions/node/v18.17.1/lib/node_modules/learnyouw3up/node_modules/execa/lib/error.js:60 error = new Error(message); ^ Error: Command failed with exit code 1: /Users/test/.nvm/versions/node/v18.17.1/bin/node /Users/test/w3up/ex3.mjs file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:51 await this.#file.stream().pipeTo(new WritableStream({ ^ TypeError: this[#file].stream is not a function at UnixFSFileBuilder.finalize (file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:51:26) at file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:33:27 at Module.createFileEncoderStream (file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:35:7) at uploadFile (file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/index.js:38:49) at Client.uploadFile (file:///Users/test/w3up/node_modules/@web3-storage/w3up-client/dist/src/client.js:92:16) Node.js v18.17.1 at makeError (file:///Users/test/.nvm/versions/node/v18.17.1/lib/node_modules/learnyouw3up/node_modules/execa/lib/error.js:60:11) at handlePromise (file:///Users/test/.nvm/versions/node/v18.17.1/lib/node_modules/learnyouw3up/node_modules/execa/index.js:124:26) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async file:///Users/test/.nvm/versions/node/v18.17.1/lib/node_modules/learnyouw3up/problems/2-cat-gifs/index.js:21:29 { shortMessage: 'Command failed with exit code 1: /Users/test/.nvm/versions/node/v18.17.1/bin/node /Users/test/w3up/ex3.mjs', command: '/Users/test/.nvm/versions/node/v18.17.1/bin/node /Users/test/w3up/ex3.mjs', escapedCommand: '"/Users/test/.nvm/versions/node/v18.17.1/bin/node" "/Users/test/w3up/ex3.mjs"', exitCode: 1, signal: undefined, signalDescription: undefined, stdout: '', stderr: 'file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:51\n' + ' await this.#file.stream().pipeTo(new WritableStream({\n' + ' ^\n' + '\n' + 'TypeError: this[#file].stream is not a function\n' + ' at UnixFSFileBuilder.finalize (file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:51:26)\n' + ' at file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:33:27\n' + ' at Module.createFileEncoderStream (file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:35:7)\n' + ' at uploadFile (file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/index.js:38:49)\n' + ' at Client.uploadFile (file:///Users/test/w3up/node_modules/@web3-storage/w3up-client/dist/src/client.js:92:16)\n' + '\n' + 'Node.js v18.17.1', cwd: '/Users/test/w3up', all: 'file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:51\n' + ' await this.#file.stream().pipeTo(new WritableStream({\n' + ' ^\n' + '\n' + 'TypeError: this[#file].stream is not a function\n' + ' at UnixFSFileBuilder.finalize (file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:51:26)\n' + ' at file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:33:27\n' + ' at Module.createFileEncoderStream (file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/unixfs.js:35:7)\n' + ' at uploadFile (file:///Users/test/w3up/node_modules/@web3-storage/upload-client/dist/src/index.js:38:49)\n' + ' at Client.uploadFile (file:///Users/test/w3up/node_modules/@web3-storage/w3up-client/dist/src/client.js:92:16)\n' + '\n' + 'Node.js v18.17.1', failed: true, timedOut: false, isCanceled: false, killed: false } Node.js v18.17.1
The text was updated successfully, but these errors were encountered:
######################################### ### YOUR SOLUTION IS NOT CORRECT! ### ######################################### Invalid CID: ""
Sorry, something went wrong.
uploadFile expects a single file, not an array. Try using uploadDirectory or files[0] in you call.
uploadFile
uploadDirectory
files[0]
No branches or pull requests
Following instructions https://web3.storage/docs/ to store a file
but getting these errors
The text was updated successfully, but these errors were encountered: