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
When uniqID is imported into vite, the following error occurs: require_os(...).networkInterfaces is not a function
After checking the code, it is because of this code: if(typeof __webpack_require__ !== 'function'){ var mac = '', networkInterfaces = require('os').networkInterfaces(); loop: for(let interface_key in networkInterfaces){ const networkInterface = networkInterfaces[interface_key]; const length = networkInterface.length; for(var i = 0; i < length; i++){ if(networkInterface[i] !== undefined && networkInterface[i].mac && networkInterface[i].mac != '00:00:00:00:00:00'){ mac = networkInterface[i].mac; break loop; } } } address = mac ? parseInt(mac.replace(/\:|\D+/gi, '')).toString(36) : '' ; }
Because webpack_require does not exist in vite, the code that enters it will report an error
The text was updated successfully, but these errors were encountered:
@xiaobeilo added vite support in v5.4.0. You can update uniqid now. There's also a vite example in the examples folder. you will need to install the vite dependencies in the vite-project. The example is in the HelloWorld.vue component.
When uniqID is imported into vite, the following error occurs:
require_os(...).networkInterfaces is not a function
After checking the code, it is because of this code:
if(typeof __webpack_require__ !== 'function'){ var mac = '', networkInterfaces = require('os').networkInterfaces(); loop: for(let interface_key in networkInterfaces){ const networkInterface = networkInterfaces[interface_key]; const length = networkInterface.length; for(var i = 0; i < length; i++){ if(networkInterface[i] !== undefined && networkInterface[i].mac && networkInterface[i].mac != '00:00:00:00:00:00'){ mac = networkInterface[i].mac; break loop; } } } address = mac ? parseInt(mac.replace(/\:|\D+/gi, '')).toString(36) : '' ; }
Because webpack_require does not exist in vite, the code that enters it will report an error
The text was updated successfully, but these errors were encountered: