Closed tabcat closed 2 years ago
using the client's Name.publish with the miniflare api from packages/api i get a rejection Uncaught SyntaxError: Unexpected end of JSON input
Uncaught SyntaxError: Unexpected end of JSON input
I may be using this wrong. This is my node REPL script:
Name = await import('@w3name/client') { W3NameService: Service } = await import('@w3name/client/service') const endpoint = new URL('http://127.0.0.1:8787') service = new Service(endpoint) name = await Name.create() keypair = name.key value = '/ipfs/bafkreiem4twkqzsq2aj4shbycd4yvoj2cx72vezicletlhi7dijjciqpui' revision = await Name.v0(name, value) await Name.publish(service, revision, name.key)
The rejection is from https://github.com/web3-storage/w3name/blob/602a20505158e558a1bfc31b6dd13e8bbb65977e/packages/client/src/index.ts#L221
By looking at res.text() instead of res.json() it looks to be a result of the response from the service being an empty string. This explains the error message
res.text()
res.json()
JSON.parse('') // Uncaught SyntaxError: Unexpected end of JSON input
It's also not setting a record for this key.
I've learned web3.storage/name is probably what I want
web3.storage/name
using the client's Name.publish with the miniflare api from packages/api i get a rejection
Uncaught SyntaxError: Unexpected end of JSON input
I may be using this wrong. This is my node REPL script:
The rejection is from https://github.com/web3-storage/w3name/blob/602a20505158e558a1bfc31b6dd13e8bbb65977e/packages/client/src/index.ts#L221
By looking at
res.text()
instead ofres.json()
it looks to be a result of the response from the service being an empty string. This explains the error messageIt's also not setting a record for this key.