After switching from js-ipfs 0.31.7 to 0.32.3 switching to embedded node in companion produces an error:
What is interesting, is that if I switch to External node and then back again to Embedded one, second time js-ipfs tries to initialize is successful and everything works as expected.
I did not look into it deeper, but my guess is that there is some sort first-run init that happens after the error occurs that fixes datastore(?) and makes following runs in the same context to work fine. Maybe IPNS tries to publish key before it is stored or something?
cc @vasco-santos in case its something obvious
To build Companion with js-ipfs v0.32.3 and run in Firefox (but the same issue is in Chromium):
git clone https://github.com/ipfs-shipyard/ipfs-companion.gitcd ipfs-companiongit reset --hard 21eb92bee2b8ea99daa3fb1836431bd63f047c24npm run dev-buildnpm run firefoxThen, go to _Preferences_ and switch to _Embedded_ node. Initial try will fail, following ones will succeed.
Hey @lidel
I see the problem. Basically, there should be a mismatch of versions for interface-datastore in the dependencies. This causes this condition to happen.
But let's fix this in the correct way! I will create a PR for interface-datastore to add the class-is module and use it instead of the instance of and update here.
@vasco-santos / @lidel can this be closed now?
@alanshaw I think we are waiting for https://github.com/ipfs/js-ipfs/pull/1617
We just need interface-datastore#24 to get released and then update the js-ipfs PR. @diasdavid can you release it?
Also bumping into this issue here: https://github.com/ipfs-shipyard/peer-star-app/pull/95
@pgte I believe @vasco-santos fixed this yesterday, to get the fix you need a fresh npm install of your modules
In this case @pgte, since you are already updating interface-datastore, datastore-core and ipfs-repo, you will need to wait for js-ipfs#1617 to get merged and released (which solves this issue).
In the meanwhile, if you do not upgrade those package versions, I think that it will work fine for you.