inversify / InversifyJS

A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
http://inversify.io/
MIT License
11.21k stars 715 forks source link

Error: module not found: inversify in Electron app after enabling the sandbox by default #1488

Closed oalfroukh closed 1 year ago

oalfroukh commented 1 year ago

Expected Behavior

Using inversify in Electron renderer process when enabling sandbox

Current Behavior

I can not use inversify in Electron renderer process when enabling sandbox while when disabling sandbox will be OK, and it's OK when using it from the main process that can use nodejs on all the cases.

Context

image

oalfroukh commented 1 year ago

Hi, I fixed the issue by adding webpack and using externals

externals: [
      nodeExternals(),
    ],

Thanks!