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

NOMINMAX missing to successfully rebuild for Electron v33.2.0 #2957

Open
LeoLTM opened this issue Dec 16, 2024 · 0 comments
Open

NOMINMAX missing to successfully rebuild for Electron v33.2.0 #2957

LeoLTM opened this issue Dec 16, 2024 · 0 comments

Comments

@LeoLTM
Copy link

LeoLTM commented Dec 16, 2024

SerialPort Version

v12.0.0

Node Version

v20.18.1

Electron Version

v33.2.0

Platform

Microsoft Windows NT 10.0.19045.0 x64

Architecture

x64

Hardware or chipset of serialport

No response

What steps will reproduce the bug?

Setup an Vite Typescript Electron project, install serialport and Firmata using npm, run npm run start which runs

electron-forge start

What happens?

While preparing the application, the native dependencies are being rebuilt for the electron-internal Node.js version. This fails because there apparently are syntax errors in the "@serialport" dependency in Firmata.

The output is similar to this issue in the nan project.

I tried Node 18 - 22 and the problem occurred every single time.
The only way I was able to fix it was by manually adding the following to node_modules\firmata\node_modules\@serialport\bindings\binding.gyp

      'defines': [
          'NOMINMAX'
      ],

so that it looks like this:

      ['OS=="win"',
        {
            'defines': [
                'NOMINMAX'
            ],
          'sources': [
            'src/serialport_win.cpp'
          ],
          'msvs_settings': {
            'VCCLCompilerTool': {
              'ExceptionHandling': '2',
              'DisableSpecificWarnings': [ '4530', '4506' ],
            }
          }
        }
      ]

What should have happened?

The Firmata / SerialPort dependency should just rebuild for the Electron Node.js version like every other native dependency.

Additional information

Another project fixed this in their bindings.gyp like this (see here), that's why I thought it might fix it for serialport as well.

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

No branches or pull requests

1 participant