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

Webpack node-sqlcipher #62

Open
nimeshkan opened this issue Jan 10, 2021 · 1 comment
Open

Webpack node-sqlcipher #62

nimeshkan opened this issue Jan 10, 2021 · 1 comment

Comments

@nimeshkan
Copy link

I tried to add to mozilla-iot code , @ry @journeyapps/sqlcipher
gateway/build/webpack:/src/sqlcipher/lib sync:2
var e = new Error("Cannot find module '" + req + "'");
^
Error: Cannot find module gateway/src/sqlcipher/lib/binding/napi-v6-linux-x64/node_sqlite3.node'
at webpackEmptyContext (gateway/build/webpack:/src/sqlcipher/lib sync:2:1)
at Object. (gateway/build/webpack:/src/sqlcipher/lib/sqlite3-binding.js:4:15)
at Object../src/sqlcipher/lib/sqlite3-binding.js gateway/build/gateway.js:17792:30)
at webpack_require (/gateway/build/webpack:/webpack/bootstrap:19:1)
at Object../src/sqlcipher/lib/sqlite3.js (gateway/build/webpack:/src/sqlcipher/lib/sqlite3.js:2:15)
at webpack_require (/home/nimesh/workspace/XERUS/HUB/Sriharsha-alert/gateway/build/webpack:/webpack/bootstrap:19:1)
at Object../src/sqlcipher/sqlite3.js (gateway/build/webpack:/src/sqlcipher/sqlite3.js:1:18)
at webpack_require (gateway/build/webpack:/webpack/bootstrap:19:1)
at Object../src/db.js gateway/build/webpack:/src/db.js:15:19)
at webpack_require (gateway/build/webpack:/webpack/bootstrap:19:1)

@rkistner
Copy link
Member

Native node modules are in general not well suited for webpack.

You should be able to exclude it from bundling by using externals, for example:

module.exports = {
  // ...
  externals: {
    '@journeyapps/sqlcipher': 'commonjs2 @journeyapps/sqlcipher',
  }
};

(not tested, and will depend on your specific setup)

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