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

can't find native module in the rendering process #2307

Closed
3 tasks done
I-Want-ToBelieve opened this issue Jun 5, 2021 · 1 comment
Closed
3 tasks done

can't find native module in the rendering process #2307

I-Want-ToBelieve opened this issue Jun 5, 2021 · 1 comment

Comments

@I-Want-ToBelieve
Copy link

I-Want-ToBelieve commented Jun 5, 2021

Preflight Checklist

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

Issue Details

  • **Electron Forge Version:6.0.0-beta.57
  • **Electron Version:v13.1.0
  • **Operating System:linux 5.12.8-arch1-1 (x64)
  • Last Known Working Electron Forge version::

Expected Behavior

can't find native module in the rendering process

Actual Behavior

Should find native module in the rendering process

To Reproduce

yarn create electron-app my-new-app --template=typescript-webpack
cd my-new-app
yarn add serialport
yarn add --dev @types/serialport
yarn package

index.ts

  app.allowRendererProcessReuse = false
  const mainWindow = new BrowserWindow({
    height: 600,
    width: 800,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
      enableRemoteModule: true,
    }
  });

renderer.ts

import './index.css';

console.log('👋 This message is being logged by "renderer.js", included via webpack');

console.log(window.require("serialport").list().then(console.log))

electron-forge start works well:
image

electron-forge package
image

@malept
Copy link
Member

malept commented Jun 5, 2021

This is a duplicate of #2302 and probably #2152 (and probably others).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants