Electron.NET icon indicating copy to clipboard operation
Electron.NET copied to clipboard

Node Module is not working after packaging the application

Open leoubaid opened this issue 4 years ago • 1 comments

Hi, I install node module with NPM and its working fine in development environment, but getting " Cannot find module" error in application after packaging it.

leoubaid avatar Jul 05 '21 06:07 leoubaid

Found any fix getting same issues?

melvin78 avatar Jul 24 '22 20:07 melvin78

🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉

With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!

GregorBiswanger avatar Mar 28 '23 15:03 GregorBiswanger

Same issue here, 23.6.1. Is there any known fix for this? For some reason it only happens with a specific module: @microsoft/signalr, other modules work fine (for example: fs, source-map-js).

Edit: Solved by adding the module to the allowlist of nodeExternals in my webpack.config.js file. No idea why I only had to do it for this specific module though. I also had to add these lines:

resolve: {
    extensions: ['.js', '.jsx', '.ts'],
}

Yuvix25 avatar Jan 11 '24 20:01 Yuvix25