This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
dag.put does not work in the js ipfs daemon with cbor-style input, even though the same request works with go-ipfs #2825
Closed
Description
I'm creating this issue here for a ipfs-http-client
problem since this repo is turning into a monorepo.
Error when doing this:
const cbor = { foo: "dag-cbor-bar" };
const cid = await ipfs.dag.put(cbor, {
format: "dag-cbor",
hashAlg: "sha2-256"
});
That's similar to what is done in the dag.put
tests, so it should be working.
This error occurs in a browser env, for instance when using js-ipfs-http-client
from a create-react-app app
Found the root of the issue by hitting a local js-ipfs daemon in debug mode DEBUG=ipfs* js-ipfs-local daemon
where js-ipfs-local
is my zsh alias for the local js-ipfs version.
The problem is in borc
via js-ipld-dag-cbor
.
On the browser side, it looks like this:
Uncaught (in promise) HTTPError: Input too short
at errorHandler (http://localhost:3000/static/js/0.chunk.js:15327:17)
at async fn (http://localhost:3000/static/js/0.chunk.js:12038:36)
at async Promise.Ky.result.<computed> [as json] (http://localhost:3000/static/js/0.chunk.js:12074:19)
at async Object.put (http://localhost:3000/static/js/0.chunk.js:13484:17)
at async dagPut (http://localhost:3000/static/js/main.chunk.js:147:17)