Context-aware native module support?
See original GitHub issueI added sqlite3 native module with TypeORM to my project. Here is my new angular.webpack.json file:
/**
* Custom angular webpack configuration
*/
const path = require('path');
module.exports = (config, options) => {
config.target = 'electron-renderer';
if (options.customWebpackConfig.target) {
config.target = options.customWebpackConfig.target;
} else if (options.fileReplacements) {
for(let fileReplacement of options.fileReplacements) {
if (fileReplacement.replace !== 'src/environments/environment.ts') {
continue;
}
let fileReplacementParts = fileReplacement['with'].split('.');
if (['dev', 'prod', 'test', 'electron-renderer'].indexOf(fileReplacementParts[1]) < 0) {
config.target = fileReplacementParts[1];
}
break;
}
}
config.externals = {
'typeorm': "require('typeorm')",
'sqlite3': "require('sqlite3')",
'react-native-sqlite-storage': 'react-native-sqlite-storage'
};
config.resolve = {
alias: {
typeorm: path.resolve(__dirname, '../node_modules/typeorm/typeorm-model-shim')
}
};
return config;
}
I get this warning at compile time:
Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
Any clue on how to prevent this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
non-context-aware native module - Automattic/node-canvas
Seeing this while running an Electron app. Uncaught Error: Loading non-context-aware native module in renderer: './node_modules/canvas/build/ ...
Read more >Electron non-context-aware native module in renderer issue
I have tried many things and can not seem to get the robotjs code to execute even with rebuild, and other examples I've...
Read more >Context awareness · The Node-API Resource - GitHub Pages
Worker Threads add a JavaScript-friendly concurrency abstraction that native add-on developers need to be aware of. What this means practically is that your ......
Read more >Electronjs, preload.js, NON context aware native modules not ...
I'm using module to create dedicated client with WEB NFC compliance/emulator for desktop OS (WEB NFC currently works on mobile only).
Read more >Native Node Modules | Electron
Native Node.js modules are supported by Electron, but since Electron has a different application binary interface (ABI) from a given Node.js binary (due...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You would use this to communicate between the main (‘main.ts’) process, dispatched using this service from the renderer process. You wont see the warning, and more importantly since its a deprecation your app will work in future versions.
For more information regarding the context of the electron processes see here
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.