You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Electron app built with react that uses serialport (successfully locally) fails once packaged. This is after running electron-rebuild as well. I can confirm the bindings.node file is found within the resources/node_modules file location. But it's almost like windows can't read it? Any tips? Been through tons of forums/discussions and every solution I've seen work for others hasn't worked here.
error images and rebuild file locations of the serialport node module
(screenshots have some different file paths since this was attempted on multiple machines with multiple different accesses, but file path always points to bindings.node within serialport node_modules)
I've created a small github repo to recreate this issue. Within this application, all I'm doing is installing the serialport package, importing it into my electron/main/index.ts, and using it in a function that isn't even called in my render process anywhere. This issue also occurred on a fully fleshed out electron app I am running locally, this is just a small example of it creating the same error. to recreate: clone this repo: https://github.com/emily-ntc/electron-vite-react-serialport , run npm install, npm rebuild, npm build (this builds a windows .exe but I confirmed you can run npm build on linux and move it into windows and it the same errors occurs). Install the app through the install, and see the error message pop up.
Not sure if I'm missing a step somewhere with how electron-rebuild works. Or maybe electron-builder isn't a supported function with node-serialport? But I haven't found a way to get this to succeed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Electron app built with react that uses serialport (successfully locally) fails once packaged. This is after running electron-rebuild as well. I can confirm the bindings.node file is found within the resources/node_modules file location. But it's almost like windows can't read it? Any tips? Been through tons of forums/discussions and every solution I've seen work for others hasn't worked here.
versions:
electron: 33.2.0
serialport: 13.0.0
vite: 5.4.11
electron-rebuild: 3.2.9
electron-builder: 24.13.3
react: 18.3.1
error images and rebuild file locations of the serialport node module
![errorMessage](https://private-user-images.githubusercontent.com/132505520/406242182-15532585-f913-4480-ab60-d23961e2fc8a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJle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I1MDIwNlQxOTAxMTdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01MWQ2MTcwOTcyMDhjZmNhM2NhNTgyMTU3Y2UxZjllZWUzNDZkMDBiMTM4ODI4YTA4Mzk0ZDk5OWUyNTJkY2E1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.NMe_95OYWzVvx3cw7dsafYC9Y0Uptd-i2uPdk15NoBs)
![errorFileLocationDetail](https://private-user-images.githubusercontent.com/132505520/406242091-e60690bb-2f6b-40de-8bb4-0d95a69511f4.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4Njg3NzcsIm5iZiI6MTczODg2ODQ3NywicGF0aCI6Ii8xMzI1MDU1MjAvNDA2MjQyMDkxLWU2MDY5MGJiLTJmNmItNDBkZS04YmI0LTBkOTVhNjk1MTFmNC5QTkc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwNlQxOTAxMTdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kMmEyMTA2OThkY2RlMzJlM2Y0NmFhZDlkOTFlMjYyZDBlZDdkZGQ0YjVjOTNkYzVhYzAwMWUyZTk2MzhkYWJlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.CvddefJnZXyRlH9d65XbraoxRIIo7l46RJoy2GQ6Cek)
(screenshots have some different file paths since this was attempted on multiple machines with multiple different accesses, but file path always points to bindings.node within serialport node_modules)
I've created a small github repo to recreate this issue. Within this application, all I'm doing is installing the serialport package, importing it into my electron/main/index.ts, and using it in a function that isn't even called in my render process anywhere. This issue also occurred on a fully fleshed out electron app I am running locally, this is just a small example of it creating the same error. to recreate: clone this repo: https://github.com/emily-ntc/electron-vite-react-serialport , run npm install, npm rebuild, npm build (this builds a windows .exe but I confirmed you can run npm build on linux and move it into windows and it the same errors occurs). Install the app through the install, and see the error message pop up.
Not sure if I'm missing a step somewhere with how electron-rebuild works. Or maybe electron-builder isn't a supported function with node-serialport? But I haven't found a way to get this to succeed.
Beta Was this translation helpful? Give feedback.
All reactions