Node Module is not working after packaging the application #682

Closed
opened 2026-01-29 16:45:55 +00:00 by claunia · 3 comments
Owner

Originally created by @leoubaid on GitHub (Jul 5, 2021).

Originally assigned to: @GregorBiswanger on GitHub.

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.

Originally created by @leoubaid on GitHub (Jul 5, 2021). Originally assigned to: @GregorBiswanger on GitHub. 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.
claunia added the bug label 2026-01-29 16:45:55 +00:00
Author
Owner

@melvin78 commented on GitHub (Jul 24, 2022):

Found any fix getting same issues?

@melvin78 commented on GitHub (Jul 24, 2022): Found any fix getting same issues?
Author
Owner

@GregorBiswanger commented on GitHub (Mar 28, 2023):

🎉🚀 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 commented on GitHub (Mar 28, 2023): 🎉🚀 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!
Author
Owner

@Yuvix25 commented on GitHub (Jan 11, 2024):

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 commented on GitHub (Jan 11, 2024): 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: ```js resolve: { extensions: ['.js', '.jsx', '.ts'], } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#682