Dynamic require of "util" is not supported #924
Unanswered
joeflateau
asked this question in
Errors
Replies: 2 comments 4 replies
-
|
Hmm, this is working for me on last night's build: 1.32.2 (you can download it at scriptkit.com if you're not on the latest): // Name: import-gopro
import "@johnlindquist/kit";
let { WebUSBDevice, getDeviceList } = await npm("usb");
const devices = getDeviceList();
const device = await WebUSBDevice.createInstance(devices[0])
dev(device) // Show my webcamOpen import-gopro in Script Kit Although the script you shared is throwing an "Error: initialize error: Error: Interface not found for address: 0" 🤷♂️ I have no idea why.... // Name: import-gopro
import "@johnlindquist/kit";
let { WebUSB } = await npm("usb");
let customWebUSB = new WebUSB({
// Bypass cheking for authorised devices
allowAllDevices: true
});
// Throws an "Initialize error 🤷♂️"
let devices = await customWebUSB.getDevices(); |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
Oh, wait a sec, are you using the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am attempting to write a script that uses node-usb to communicate with a GoPro camera. Node-usb calls
require("util")internally. script kit/esbuild does not seem to like this.Dynamic/async import doesn't seem to help either
Beta Was this translation helpful? Give feedback.
All reactions