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

Security: Is there a better solution to import serialport without setting " nodeIntegration: true; contextIsolation: false" #201

Open
gaspardruan opened this issue Feb 22, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@gaspardruan
Copy link

gaspardruan commented Feb 22, 2024

I set the renderer plugin as document suggests, everything is fine with importing serialport when:

renderer({
      resolve: {
        serialport: { type: "cjs" },
      },
 })
win = new BrowserWindow({
    webPreferences: {
      contextIsolation: false,
      nodeIntegration: true,
    },
  });

But electron document said that this is not suggested for security.

So, I delete the two settings, then problem occured:
image

I wonder if there is a better solution to import serailport without the above settings.

@gaspardruan gaspardruan added the help wanted Extra attention is needed label Feb 22, 2024
@gaspardruan gaspardruan changed the title [Help] Error: "dynamic require of 'x' is not supported" occurs when importing 'tree-sitter' Security: Is there a better solution to import serialport without setting " nodeIntegration: true; contextIsolation: false" Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant