Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Error: No resolver found for codec "undefined" in the browser #1738

Closed
m00nwtchr opened this issue Nov 28, 2018 · 2 comments
Closed

Error: No resolver found for codec "undefined" in the browser #1738

m00nwtchr opened this issue Nov 28, 2018 · 2 comments

Comments

@m00nwtchr
Copy link

m00nwtchr commented Nov 28, 2018

  • Version: 0.33.1
  • Platform: Linux lukas2005-local 4.18.18-200.fc28.x86_64 Add to cli: ipfs pin [-r] <ipfs-path> #1 SMP Mon Nov 12 03:17:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: Graph (object.put)

Type: Bug

Severity: Medium

Description:

ipfs.object.put(new Buffer(data)) doesn't work when used in the browser (bundled with webpack)
Error:

ACCESS ERROR: Error: No resolver found for codec "undefined" ipfs-access-controller.js:33
    at IPLDResolver.put (index.js:221)
    at next (object.js:204)
    at DAGNode.create (object.js:176)
    at multihashing (create.js:53)
    at Multihashing.Multihashing.digest (index.js:33)
    at index.js:15
    at ./node_modules/core-js/modules/_invoke.js.module.exports (_invoke.js:5)
    at queue.(:8000/anonymous function) (http://localhost:8000/bundle.js:69449:7)
    at Number.run (_task.js:21)
    at MessagePort.listener (_task.js:25)

ipfs-access-controller is a file from orbit-db
https://github.com/orbitdb/orbit-db/blob/master/src/ipfs-access-controller.js#L33

Steps to reproduce the error:

git clone https://github.com/Anchor-Chat/Anchor-Web.git
cd Anchor-Web
npm i
npm start

now open http://localhost:8000 in the web browser (i used the latest chrome)
now type in any password and login and click "register"
An error message should pop up in the UI but to get details see the developer console.

@alanshaw
Copy link
Member

@lukas2005 I've just tried ipfs.object.put(new Buffer('ddd')) using our webpack example https://github.com/ipfs/js-ipfs/tree/master/examples/browser-webpack and I'm not getting the error. I suspect this is an error in your application code or in the orbitdb code or possibly in the webpack config being used. Please re-open a new issue if you discover this to not be the case.

@m00nwtchr
Copy link
Author

m00nwtchr commented Nov 29, 2018

@alanshaw One thing i discovered (that's too small to make a complete new issue for) if i replace
const r = this.resolvers[options.format](line 219) with
const r = this.resolvers[options.format || options.cid.codec]
everything works fine
isn't options.format supposed to be optional?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants