Javascript downlink example creates error


when following the JS example for queueing a downlink, I get an error which I isolated comes from the following line:
const deviceService = new device_grpc.DeviceServiceClient(server, grpc.credentials.createInsecure());

The error is: TypeError: Cannot read properties of undefined (reading 'credentials')

Is there a specific version of grpc I need to use? Thanks!

I have solved the issue. The fix is to use a require statement instead of importing like recommended by multiple IDEs.