Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
electron.js remote and "Invalid knex instance" #2060
Comments
What's a |
Electron is an open source framework that allows for the development of desktop GUI applications using web technologies. Electron remote let you use main process modules from the renderer process. https://www.electronjs.org/docs/api/remote Since web technologies does not have access to filesystem (and other native features), electron provides an inter-process communication layer with |
What kind of object is |
It returns a |
I'm not very comfortable changing the current behavior just for this corner case. If you can find a way to continue preventing people from passing random objects and ensuring only valid Knex instances are accepted I can accept a PR. Also, why are you doing database access in the render process side? Doesn't Electron allow doing that on the remote side and then just send the needed data to the render process? |
Ok, it makes sense. I will try to find a solution and i'll let you know in case of success, thank you. I use the remote module just to save me a lots of manual ipc messages back and forth. |
Introduction
Invalid knex instance
if you requireknex
with electron.jsremote
.Issue Description
Here https://github.com/bookshelf/bookshelf/blob/master/lib/bookshelf.js#L32 you check the name of knex instance, but if the instance is initialized with electron.js
remote
, the name is "remoteFunction".Steps to reproduce issue
Expected behaviour
The expected behaviour is without exception. Infact, I changed that line with:
if (!knex) {
and everything works as expected.Actual behaviour