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

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

Closed
oalfroukh opened this issue Nov 28, 2022 · 1 comment

Comments

@oalfroukh
Copy link

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

  • Electron v20 has a breaking change feat: sandbox preloads by default electron/electron#35125 , after enabling sandbox we got an error Error: module not found: inversify that will prevent loading the preload script, while when disabling sandbox will be OK, but we would like to apply Electron recommendations for the security on our app.

image

Your Environment

  • Version used: inversify v6.0.1
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Electron v20 and up
  • Operating System and version (desktop or mobile): Windows OS
  • Link to your project: Here is a quick app on GitHub to reproduce the issue
@oalfroukh
Copy link
Author

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

externals: [
      nodeExternals(),
    ],

Thanks!

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

1 participant