Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests with better-sqlite3 do not work in electron-vue project #94

Closed
sumdog opened this issue Jan 21, 2018 · 3 comments
Closed

tests with better-sqlite3 do not work in electron-vue project #94

sumdog opened this issue Jan 21, 2018 · 3 comments

Comments

@sumdog
Copy link

sumdog commented Jan 21, 2018

I originally reported this on the electron issue tracker and also created a stack overflow post for this, but I thought this might be more a better-sqlite3 issue, so I'm creating the issue here as well.

I'm using the vue-electron boilerplate with the better-sqlite3 library, however whenever I try to run unit tests using yarn test (which calls npm) I get the following error:

08 12 2017 23:45:19.463:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
08 12 2017 23:45:19.465:INFO [launcher]: Launching browser visibleElectron with unlimited concurrency
08 12 2017 23:45:19.530:INFO [launcher]: Starting browser Electron
08 12 2017 23:45:20.577:INFO [Electron 1.7.9 (Node 7.9.0)]: Connected on socket pezqFj1bsIJV52JrAAAA with id 7899584
Electron 1.7.9 (Node 7.9.0) ERROR
  Uncaught Error: Could not locate the bindings file. Tried:
   → /home/cassius/workspace/tagister/node_modules/better-sqlite3/build/better_sqlite3.node
   → /home/cassius/workspace/tagister/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
   → /home/cassius/workspace/tagister/node_modules/better-sqlite3/build/Release/better_sqlite3.node
   → /home/cassius/workspace/tagister/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
   → /home/cassius/workspace/tagister/node_modules/better-sqlite3/Debug/better_sqlite3.node
   → /home/cassius/workspace/tagister/node_modules/better-sqlite3/out/Release/better_sqlite3.node
   → /home/cassius/workspace/tagister/node_modules/better-sqlite3/Release/better_sqlite3.node
   → /home/cassius/workspace/tagister/node_modules/better-sqlite3/build/default/better_sqlite3.node
   → /home/cassius/workspace/tagister/node_modules/better-sqlite3/compiled/7.9.0/linux/x64/better_sqlite3.node
  at webpack:///node_modules/bindings/bindings.js:96:0 <- index.js:30116

Even though the bindings do exist:

find $HOME/workspace/tagister/node_modules/better-sqlite3/ -name "*node"
/home/cassius/workspace/tagister/node_modules/better-sqlite3/build/Release/test_extension.node
/home/cassius/workspace/tagister/node_modules/better-sqlite3/build/Release/better_sqlite3.node
/home/cassius/workspace/tagister/node_modules/better-sqlite3/build/Release/obj.target/test_extension.node
/home/cassius/workspace/tagister/node_modules/better-sqlite3/build/Release/obj.target/better_sqlite3.node

I know to get better-sqlite3 to work in development mode, I had to add "postinstall": "electron-builder install-app-deps" to the scripts section of my package.json. Is there anything I need to do specifically to make this package available in the tests or is this some kind of electron bug?

Reproduce

git clone https://gitlab.com/djsumdog/tagster.git
git checkout ca712c4c
yarn
yarn test
@JoshuaWise
Copy link
Member

I've never used electron, but other people who have reported electron-related bugs have fixed them all by using electron-rebuild.

@JoshuaWise
Copy link
Member

closed in favor of #126

@mandaputtra
Copy link

i'm still had this error with electron rebuild

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants