Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ServiceClient
✓ import { ServiceClient } from '@infinimesh/proto/infinimesh/device/v1/device_connect'
✗ import ServiceClient from '@infinimesh/proto/infinimesh/device/v1/device_connect'
Named export from Connect-ES generated files; default import will fail.
DeviceService
✓ import { DeviceService } from '@infinimesh/proto/infinimesh/device/v1/device_pb'
✗ const { DeviceService } = require('@infinimesh/proto/infinimesh/device/v1/device_pb')
ESM-only package; CJS require not supported. Use import syntax.
createPromiseClient
✓ import { createPromiseClient } from '@bufbuild/connect'
✗ import { createPromiseClient } from '@infinimesh/proto'
createPromiseClient is from @bufbuild/connect, not from the proto package.
createRouterTransport
✓ import { createRouterTransport } from '@bufbuild/connect'
Used for server-side testing; exported from @bufbuild/connect.
Creates a Connect-ES client for the DeviceService, demonstrating import paths and transport setup.
import { createPromiseClient } from '@bufbuild/connect';
import { createConnectTransport } from '@bufbuild/connect-web';
import { DeviceService } from '@infinimesh/proto/infinimesh/device/v1/device_pb';
const transport = createConnectTransport({
baseUrl: process.env.INFINIMESH_API_URL ?? 'https://api.infinimesh.cloud',
});
async function main() {
const client = createPromiseClient(DeviceService, transport);
const res = await client.getDevice({ id: 'my-device' });
console.log(res);
}
main();
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/node_modules/@infinimesh/proto/... from /path/app.js not supported.
Using CommonJS require instead of import.
fixAdd "type": "module" to package.json or use import syntax.
Module not found: Can't resolve '@infinimesh/proto/infinimesh/device/v1/device_connect'
Missing or incorrect package install; or not using the correct subpath import.
fixEnsure package is installed: npm install @infinimesh/proto. Verify import path matches the generated files.
TypeError: (0 , createPromiseClient) is not a function
Importing createPromiseClient from the wrong package (e.g., @infinimesh/proto itself).
fixImport createPromiseClient from '@bufbuild/connect'.
Error: Cannot find module '@bufbuild/protobuf'
Missing required runtime dependency.
fixInstall @bufbuild/protobuf: npm install @bufbuild/protobuf.
Uncaught TypeError: DeviceService.getDevice is not a function
Using the service object directly instead of creating a client.
fixUse createPromiseClient to instantiate a client: const client = createPromiseClient(DeviceService, transport); then call client.getDevice().
Audit
Dependencies
@bufbuild/protobufrequiredRuntime dependency for Connect-ES generated code
@bufbuild/connectoptionalRequired for Connect-ES transport
@bufbuild/connect-weboptionalRequired for browser usage