i'm working on project i need from client to connect to serial port of Weighing machine scale and click on another button to get data in realtime in one line without using any library like node Serialport
`
<script setup>
import { Head, Link } from "@inertiajs/vue3";
import { ref } from "@vue/reactivity";
import {SerialPort} from 'serialport'
function connectToSerialPort(portName) {
const port = new SerialPort(portName, { baudRate: 9600 });
port.on('error', function(err) {
console.log('Error: ', err.message);
});
port.on('data', function(data) {
console.log('Data:', data.toString());
});
console.log(`Connecting to serial port ${portName}...`);
}
connectToSerialPort('COM4');
</script>
dex.js:10 Uncaught (in promise) TypeError: Class extends value undefined is not a constructor or null
at node_modules/@serialport/parser-byte-length/dist/index.js (index.js:10:41)
at __require2 (chunk-NKHIPFFU.js?v=b0a45716:15:50)
at node_modules/serialport/dist/index.js (index.js:13:14)
at __require2 (chunk-NKHIPFFU.js?v=b0a45716:15:50)
at index.js:24:46
n`