I have the following renderer:
import SerialPort from \"serialport\";
new SerialPort(\"/dev/tty-usbserial1\", { baudRate: 57600 });
It\'s buil
I had a similar error when tried to use a native module in electron-renderer
.
Although the error message was something like this in my case:
node-loader: The specified module could not be found
I believe it's all related to node loaders. For me, native-addon-loader was the loader that worked great.
Also, make sure your Webpack target is either node
, electron-main
or electron-renderer
, otherwise it won't work (native modules can't be used on the client side).