JSBI.BigInt is not a function /node_modules/dbus-next/lib/marshallers.js?:255:24
Just importing dbus-next in a new javascript file causes this error:
DBus.js :
import { sessionBus, } from 'dbus-next';

Environment Info:
System:
OS: Linux 5.3 Ubuntu 18.04.4 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
Binaries:
Node: 14.3.0 - ~/.nvm/versions/node/v14.3.0/bin/node
Yarn: 1.22.4 - /usr/bin/yarn
npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm
Browsers:
Chrome: 83.0.4103.116
Firefox: 78.0.1
npmGlobalPackages:
@vue/cli: 4.4.4
"dbus-next": "^0.8.2"
How to solve the problem?
Marco
https://github.com/dbusjs/mpris-service/issues/23
Put this in your webpack config:
resolve: {
alias: {
jsbi: path.resolve(__dirname, 'node_modules', 'jsbi', 'dist', 'jsbi-cjs.js')
}
},
Hi @acrisci Tony! After putting alias in webpack config should I do something else?
Now in webpack.config.js :
resolve: {
extension: ["*", ".pem"],
alias: {
jsbi: path.resolve(__dirname, 'node_modules', 'jsbi', 'dist', 'jsbi-cjs.js')
}
},
But I still have the same error
This fix has worked for 3-4 people. Make sure the path for the alias is actually pointing to an existing file in the node modules.
The path sbi: path.resolve(__dirname, 'node_modules', 'jsbi', 'dist', 'jsbi-cjs.js') seems correct:
(base) marco@pc01:~/webMatters/vueMatters/GGC/node_modules/jsbi/dist$ ls -lah
total 92K
drwxr-xr-x 2 marco marco 4,0K lug 14 14:45 .
drwxr-xr-x 3 marco marco 4,0K lug 14 14:45 ..
-rw-r--r-- 1 marco marco 26K lug 14 14:45 jsbi-cjs.js
-rw-r--r-- 1 marco marco 26K lug 14 14:45 jsbi.mjs
-rw-r--r-- 1 marco marco 25K lug 14 14:45 jsbi-umd.js
If you're using vue, I think the webpack config is a little different.
https://github.com/dbusjs/mpris-service/issues/45
module.exports = {
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: config => {
config.resolve.alias.set('jsbi', path.join(__dirname, 'node_modules/jsbi/dist/jsbi-cjs.js'));
}
},
},
};
I added at the end of webpack.config.js file :
module.exports = {
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: config => {
config.resolve.alias.set('jsbi', path.join(__dirname, 'node_modules/jsbi/dist/jsbi-cjs.js'));
}
},
},
};
But still get this error:

I think I might try to make JSBI optional so it never gets imported if you don't use it.
f1e2b4a should make the alias not required if you don't use jsbi compatibility mode. Try that out and see if it fixes it.