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

Require module doesn't work at built application #3737

Open
3 tasks done
keenoptical opened this issue Oct 11, 2024 · 2 comments
Open
3 tasks done

Require module doesn't work at built application #3737

keenoptical opened this issue Oct 11, 2024 · 2 comments
Labels
blocked/needs-repro Issues unable to be reproduced by maintainers

Comments

@keenoptical
Copy link

keenoptical commented Oct 11, 2024

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.5.0

Electron version

32.2.0

Operating system

Windows 11

Last known working Electron Forge version

Expected behavior

Require module works as usual.

Actual behavior

Require module throws error "Module not found" at built application.

Steps to reproduce

I am trying to require module from node_modules using standart node module api: const neededModule = require("agora-electron-sdk"). Locally everything works correctly, but after building application using electron-forge make i've got these error:
Image
Such behavior appears both at main.js and preload.js. Here is fragment of my BrowserWindow config which probably shall allow using node modules in renderer context:

  webPreferences: {
      preload: path.join(__dirname, 'preload.js'),
      nodeIntegration: true,
      contextIsolation: false,
      nodeIntegrationInWorker: true,
   },

How to make require module work at already built application if there is special need to add non-esm module at project?

Additional information

No response

@acgrid
Copy link

acgrid commented Oct 28, 2024

Maybe introduced as 7.5.0, 7.4.0 worked as expected.
I checked the built app.asar, no node_modules folder is found.

@VerteDinde VerteDinde added the blocked/needs-repro Issues unable to be reproduced by maintainers label Nov 20, 2024
@VerteDinde
Copy link
Member

Thanks for reporting this issue. Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? I'm adding the blocked/need-repro label for this reason. After you make a test case, please link to it in a followup comment.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/needs-repro Issues unable to be reproduced by maintainers
Projects
None yet
Development

No branches or pull requests

3 participants