Comments (6)
Try this:
diff --git a/webpack/config.electron.js b/webpack/config.electron.js
index 297e8cb..208e647 100644
--- a/webpack/config.electron.js
+++ b/webpack/config.electron.js
@@ -15,5 +15,10 @@ module.exports = {
target: 'electron-main',
node: {
__dirname: false
+ },
+ resolve: {
+ alias: {
+ jsbi: path.resolve(__dirname, '..', 'node_modules', 'jsbi', 'dist', 'jsbi-cjs.js')
+ }
}
}
Note that the exact solution above won't work because your node_modules
is at a different relative path. You have to add the '..'
to the resolve path.
from mpris-service.
App threw an error during load
TypeError: JSBI.BigInt is not a function
at eval (webpack:///./node_modules/dbus-next/lib/marshallers.js?:255:24)
at Object../node_modules/dbus-next/lib/marshallers.js (/home/rapiz/Source/Petal/public/main.js:503:1)
at __webpack_require__ (/home/rapiz/Source/Petal/public/main.js:20:30)
at eval (webpack:///./node_modules/dbus-next/lib/marshall.js?:5:21)
at Object../node_modules/dbus-next/lib/marshall.js (/home/rapiz/Source/Petal/public/main.js:492:1)
at __webpack_require__ (/home/rapiz/Source/Petal/public/main.js:20:30)
at eval (webpack:///./node_modules/dbus-next/lib/message.js?:2:18)
at Object../node_modules/dbus-next/lib/message.js (/home/rapiz/Source/Petal/public/main.js:514:1)
at __webpack_require__ (/home/rapiz/Source/Petal/public/main.js:20:30)
at eval (webpack:///./node_modules/dbus-next/lib/connection.js?:3:17)
A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: JSBI.BigInt is not a function
at eval (webpack:///./node_modules/dbus-next/lib/marshallers.js?:255:24)
at Object../node_modules/dbus-next/lib/marshallers.js (/home/rapiz/Source/Petal/public/main.js:503:1)
at __webpack_require__ (/home/rapiz/Source/Petal/public/main.js:20:30)
at eval (webpack:///./node_modules/dbus-next/lib/marshall.js?:5:21)
at Object../node_modules/dbus-next/lib/marshall.js (/home/rapiz/Source/Petal/public/main.js:492:1)
at __webpack_require__ (/home/rapiz/Source/Petal/public/main.js:20:30)
at eval (webpack:///./node_modules/dbus-next/lib/message.js?:2:18)
at Object../node_modules/dbus-next/lib/message.js (/home/rapiz/Source/Petal/public/main.js:514:1)
at __webpack_require__ (/home/rapiz/Source/Petal/public/main.js:20:30)
at eval (webpack:///./node_modules/dbus-next/lib/connection.js?:3:17)
Looks similar to #23 . So I applied the solution in that.
Got:
WARNING in ./node_modules/dbus-next/lib/address-x11.js
Module not found: Error: Can't resolve 'x11' in '/home/rapiz/Source/Petal/node_modules/dbus-next/lib'
@ ./node_modules/dbus-next/lib/address-x11.js
@ ./node_modules/dbus-next/lib/connection.js
@ ./node_modules/dbus-next/index.js
@ ./node_modules/mpris-service/dist/index.js
@ ./electron/mpris.js
@ ./electron/main.dev.js
ERROR in ./node_modules/dbus-next/lib/dbus-buffer.js
Module not found: Error: Can't resolve 'jsbi' in '/home/rapiz/Source/Petal/node_modules/dbus-next/lib'
@ ./node_modules/dbus-next/lib/dbus-buffer.js 3:13-28
@ ./node_modules/dbus-next/lib/message.js
@ ./node_modules/dbus-next/lib/connection.js
@ ./node_modules/dbus-next/index.js
@ ./node_modules/mpris-service/dist/index.js
@ ./electron/mpris.js
@ ./electron/main.dev.js
ERROR in ./node_modules/dbus-next/lib/marshallers.js
Module not found: Error: Can't resolve 'jsbi' in '/home/rapiz/Source/Petal/node_modules/dbus-next/lib'
@ ./node_modules/dbus-next/lib/marshallers.js 4:13-28
@ ./node_modules/dbus-next/lib/marshall.js
@ ./node_modules/dbus-next/lib/message.js
@ ./node_modules/dbus-next/lib/connection.js
@ ./node_modules/dbus-next/index.js
@ ./node_modules/mpris-service/dist/index.js
@ ./electron/mpris.js
@ ./electron/main.dev.js
ERROR in ./node_modules/mpris-service/dist/interfaces/player.js
Module not found: Error: Can't resolve 'jsbi' in '/home/rapiz/Source/Petal/node_modules/mpris-service/dist/interfaces'
@ ./node_modules/mpris-service/dist/interfaces/player.js 35:13-28
@ ./node_modules/mpris-service/dist/index.js
@ ./electron/mpris.js
@ ./electron/main.dev.js
error Command failed with exit code 2.
from mpris-service.
Tried to edit ./node_modules/mpris-sevice/src/index.js and ./node_modules/mpris-sevice/dist/index.js. Change dbus.setBigIntCompat(true);
to dbus.setBigIntCompat(false);
but did not work. The same error. TypeError: JSBI.BigInt is not a function
In my understanding of node-dbus-next#Compat, after I changed the compat option it would not use JSBI and it would not produce a error containing JSBI stuff. It's really confusing.
from mpris-service.
Change dbus.setBigIntCompat(true); to dbus.setBigIntCompat(false); but did not work.
This only affects what the public api returns. Internally, it still uses JSBI because it simplifies the code path. But maybe that should be revisited and we should make that dependency really optional since it seems to be causing webpack problems.
Can you link to your branch where you are working on the implementation so I can look at it?
from mpris-service.
https://github.com/Rapiz1/Petal/tree/94e19158771fe947aa3f0308b3084d155cf2238e
I have not really implement it yet. Just tested.
electron/mpris.js
mostly comes from mpris-service
example code.
electron/main.dev.js
just add the line import './mpris'
from mpris-service.
It works.Thanks :)
from mpris-service.
Related Issues (20)
- Error: The module was compiled against a different Node.js version using NODE_MODULE_VERSION 48. HOT 6
- Metadata don't work HOT 5
- CanGoPrevious & CanGoNext variable updating but mpris is not HOT 2
- Add CI HOT 5
- mpris-service 2.0 fails because of JSBI.BigInt with Webpack HOT 9
- Sending/Receiving negative numbers HOT 2
- Player implementation status
- Support multiple instances
- DBus connection error handling
- Documentation hosting HOT 1
- Move to dbusjs organization HOT 2
- Media Keys stop working after closing window HOT 4
- Got error when detecting the player status using other scripts HOT 3
- TypeError: JSBI.BigInt is not a function HOT 4
- Changing property results in EPIPE errors HOT 3
- use latest dbus-next HOT 4
- Typo: `that` instead of `this` HOT 1
- Error while executing `GetAll` on `org.freedesktop.DBus.Properties`
- Can I use this to discover other players? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpris-service.