diff --git a/apps/api/src/routes/devices.ts b/apps/api/src/routes/devices.ts index bb9e71b..157e2df 100644 --- a/apps/api/src/routes/devices.ts +++ b/apps/api/src/routes/devices.ts @@ -1,6 +1,11 @@ import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify"; import type Database from "better-sqlite3"; -import { getVendor } from "mac-oui-lookup"; +// mac-oui-lookup is CommonJS; Node's ESM interop doesn't reliably expose its +// named exports (crashed the whole process on startup with +// "Named export 'getVendor' not found" despite working fine under +// require()) -- import the default and destructure instead. +import macOuiLookup from "mac-oui-lookup"; +const { getVendor } = macOuiLookup; import { getRecentDevices, setDeviceLabel, clearDeviceLabel, type DeviceRow } from "../db/index.js"; async function requireAuth(req: FastifyRequest, reply: FastifyReply) {