{"record":{"id":"c5277b1d548fbc29","repo":"denoland/deno","slug":"no-callback-function-supplied-c5277b","errorCode":null,"errorMessage":"No callback function supplied","messagePattern":"No callback function supplied","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ext/node/polyfills/_fs/_fs_lutimes.ts","lineNumber":60,"sourceCode":"  const unixSeconds = toUnixTimestamp(value);\n\n  const seconds = MathTrunc(unixSeconds);\n  const nanoseconds = MathTrunc((unixSeconds * 1e3) - (seconds * 1e3)) * 1e6;\n\n  return [\n    seconds,\n    nanoseconds,\n  ];\n}\n\nexport function lutimes(\n  path: PathLike,\n  atime: TimeLike,\n  mtime: TimeLike,\n  callback: CallbackWithError,\n): void {\n  if (!callback) {\n    throw new Error(\"No callback function supplied\");\n  }\n  const { 0: atimeSecs, 1: atimeNanos } = getValidUnixTime(atime, \"atime\");\n  const { 0: mtimeSecs, 1: mtimeNanos } = getValidUnixTime(mtime, \"mtime\");\n\n  path = getValidatedPathToString(path);\n\n  PromisePrototypeThen(\n    op_node_lutimes(path, atimeSecs, atimeNanos, mtimeSecs, mtimeNanos),\n    () => callback(null),\n    callback,\n  );\n}\n\nexport function lutimesSync(\n  path: PathLike,\n  atime: TimeLike,\n  mtime: TimeLike,\n): void {","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/ext/node/polyfills/_fs/_fs_lutimes.ts#L42-L78","documentation":"fs.lutimes(path, atime, mtime, callback) throws this plain Error (no code) when callback is falsy. Unlike lstat/readdir it has no options overload, so exactly four arguments are expected; calling it with three (or with a missing/undefined callback) always trips this guard before any time validation happens.","triggerScenarios":"fs.lutimes(path, atime, mtime) with no fourth argument; destructuring a callback from an object that does not define it and passing undefined.","commonSituations":"Switching from fs.promises.lutimes to fs.lutimes and dropping the callback; writing a wrapper that forwards (...args) but callers omit the last one.","solutions":["Use fs.promises.lutimes(path, atime, mtime) for promise-style code","Otherwise pass a fourth function argument: fs.lutimes(path, atime, mtime, err => { ... })","In wrappers, assert typeof args[3] === 'function' before delegating"],"exampleFix":"// before\nfs.lutimes(path, atime, mtime);\n\n// after\nawait fs.promises.lutimes(path, atime, mtime);\n// or\nfs.lutimes(path, atime, mtime, (err) => { if (err) throw err; });","handlingStrategy":"validation","validationCode":"if (typeof callback !== 'function') {\n  throw new Error('lutimes(path, atime, mtime, callback) requires a 4th callback argument');\n}","typeGuard":"const isCallback = (v) => typeof v === 'function';","tryCatchPattern":null,"preventionTips":["Use fs.promises.lutimes for promise-style code","lutimes has no options overload — the 4th positional argument is always the callback","Let TypeScript's arity checking catch missing arguments"],"tags":["node-compat","fs","lutimes","callback","api-misuse"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}