When packaging the Electron app into an AppImage an running it the following exception is thrown at the line when the node is created via const node = await IPFS.create():
TypeError: Queue is not a constructor
at createMutex (/tmp/.mount_electrCHCd44/resources/app.asar/node_modules/mortice/lib/index.js:18:23)
at module.exports (/tmp/.mount_electrCHCd44/resources/app.asar/node_modules/mortice/lib/index.js:106:21)
at module.exports (/tmp/.mount_electrCHCd44/resources/app.asar/node_modules/ipfs-mfs/src/core/utils/create-lock.js:12:17)
at module.exports (/tmp/.mount_electrCHCd44/resources/app.asar/node_modules/ipfs-mfs/src/core/index.js:71:16)
at Object.module.exports [as filesMFS] (/tmp/.mount_electrCHCd44/resources/app.asar/node_modules/ipfs/src/core/components/files-mfs.js:28:19)
at new IPFS (/tmp/.mount_electrCHCd44/resources/app.asar/node_modules/ipfs/src/core/index.js:111:29)
at Function.module.exports.create (/tmp/.mount_electrCHCd44/resources/app.asar/node_modules/ipfs/src/core/index.js:180:10)
at App.<anonymous> (/tmp/.mount_electrCHCd44/resources/app.asar/background.js:33:94330)
at App.emit (events.js:205:15)
This exception is not thrown in development mode when running via yarn run electron:serve.
See instructions at https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/416
and run yarn run electron:build and run the .AppImage in the dist_electron subfolder.
Can you confirm which version of p-queue is in your bundle? It looks like the default export changed between v5 and v6.
In app.asar, if I unpack it:
{
"name": "p-queue",
"version": "6.1.1",
...
}
Is there no other version in there? mortice, where the error is being thrown from, depends on p-queue@^5.0.0 so it's not going to work if only v6 is present.
It can be updated to require v6 instead, but if your build process is flattening the dependency tree and consequently including incompatible versions you're probably going to have other problems.
Mortice now depends on v6 which should help, please open an issue on the mortice repo if you continue to have problems.
Upgraded to ipfs 0.37.1 but the issue seems to be with libp2p-kad-dht@~0.15.3. Here are the dependencies from yarn list:
โโ [email protected]
โ โโ libp2p-kad-dht@~0.15.3
โโ [email protected]
โ โโ p-queue@^5.0.0
โ โโ [email protected]
โ โ โโ eventemitter3@^3.1.0
This means that libp2p-kad-dht is currently holding off p-queue v6 from being bundled in the final app.asar.
See: https://github.com/libp2p/js-libp2p-kad-dht/blob/master/package.json which has a hard dependency on p-queue v5.
I'm getting this same issue
@achingbrain can we reopen this?
Thanks for the PR @mboperator - re-opening this until https://github.com/libp2p/js-libp2p-kad-dht/pull/146 gets merged and released.
Confirmed that this bug isn't fixed with [email protected]
It's due to ipfs-repo relying on p-queue@^5.0.0
I've confirmed that the error in this issue goes away with the pull request linked above.
Unfortunately, another error related to p-queue and p-timeout occurs.
Update:
I've confirmed that the previously mentioned issue with p-queue and p-timeout no longer occurs.
Thanks for creating js-ipfs!
Woohoo! Thanks for tracking this down and getting it fixed @mboperator!!
Most helpful comment
Update:
I've confirmed that the previously mentioned issue with
p-queueandp-timeoutno longer occurs.2574 Fixes ipfs in Electron ๐
Thanks for creating
js-ipfs!