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

Worker_Threads: Unable to find dialect #40

Closed
Hirobreak opened this issue Jul 21, 2020 · 3 comments
Closed

Worker_Threads: Unable to find dialect #40

Hirobreak opened this issue Jul 21, 2020 · 3 comments

Comments

@Hirobreak
Copy link

Hello, I'm running a worker_thread that needs to read a copy of my encrypted database.

Unfortunately when I try to connect to my database I get the following error: UnhandledPromiseRejectionWarning: Error: Unable to find dialect at @journeyapps/sqlcipher.

This is my database setup

sequelize = new Sequelize(null, null, key, {
    dialect: 'sqlite',
    dialectModulePath: '@journeyapps/sqlcipher',
    storage: path,
    logging: false,
    transactionType: 'IMMEDIATE'
  });

I have been reading about this issue and it might be related to Enabling Context-Awareness, here's some info about it Context-Awareness and Example of Context-Awareness Fix

I'm running Electron 8 which runs Node 12.13.0 and I'm using Sequelize 5.21.2 and @journeyapps/sqlcipher 4.0.0
I'm able to import any other module I use on the rest of my electron app but this one, any help would be much appreciated

@rkistner
Copy link
Member

The current version does not support running with worker_thread.

The upstream node-sqlcipher3 project had some recent changes that could fix the issue. The changes will be included here soon.

@rkistner
Copy link
Member

This now does seem to work with worker_thread on Node 14 / N-API 6. Earlier versions may appear to work, but are likely to run into crashes.

Electron 10 is based on Node v12.16.3, so worker_threads will not work yet.

@rkistner
Copy link
Member

Also note that there are more unresolved upstream issues related to worker_threads:

TryGhost/node-sqlite3#1381

Best is to track the issues there, and update the project here if there are any fixes.

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

No branches or pull requests

2 participants