{"record":{"id":"01d8641e18948a93","repo":"cube-js/cube","slug":"options-meta-must-be-a-function","errorCode":null,"errorMessage":"options.meta must be a function","messagePattern":"options\\.meta must be a function","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cubejs-backend-native/js/index.ts","lineNumber":400,"sourceCode":"export const registerInterface = async (options: SQLInterfaceOptions): Promise<SqlInterfaceInstance> => {\n  if (typeof options !== 'object' && options == null) {\n    throw new Error('Argument options must be an object');\n  }\n\n  if (typeof options.contextToApiScopes !== 'function') {\n    throw new Error('options.contextToApiScopes must be a function');\n  }\n\n  if (typeof options.checkAuth !== 'function') {\n    throw new Error('options.checkAuth must be a function');\n  }\n\n  if (typeof options.checkSqlAuth !== 'function') {\n    throw new Error('options.checkSqlAuth must be a function');\n  }\n\n  if (typeof options.meta !== 'function') {\n    throw new Error('options.meta must be a function');\n  }\n\n  if (typeof options.stream !== 'function') {\n    throw new Error('options.stream must be a function');\n  }\n\n  if (typeof options.sqlApiLoad !== 'function') {\n    throw new Error('options.sqlApiLoad must be a function');\n  }\n\n  if (typeof options.sqlGenerators !== 'function') {\n    throw new Error('options.sqlGenerators must be a function');\n  }\n\n  if (typeof options.sql !== 'function') {\n    throw new Error('options.sql must be a function');\n  }\n","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-backend-native/js/index.ts#L382-L418","documentation":"Configuration guard in registerInterface (cubejs-backend-native): the generic sentinel `options.meta must be a function` check fires when the SQLInterfaceOptions object passed to registerInterface omits the meta callback, which the native SQL interface needs to serve /meta requests.","triggerScenarios":"Calling registerInterface() with an options object whose meta property is missing or not a function.","commonSituations":"Assembling the options programmatically and skipping meta; older integrations where meta was supplied elsewhere; accidental overwrite with a Promise or object instead of the handler function.","solutions":["Pass a meta function in the options object when calling registerInterface.","Verify the object was constructed correctly and meta was not renamed or omitted in a refactor."],"exampleFix":"// before\nawait registerInterface({ contextToApiScopes, checkAuth, checkSqlAuth, stream, sqlApiLoad });\n\n// after\nawait registerInterface({\n  contextToApiScopes, checkAuth, checkSqlAuth,\n  meta: async (context, query) => compilerApi.meta(context, query),\n  stream, sqlApiLoad\n});","handlingStrategy":"validation","validationCode":"if (typeof options.meta !== 'function') {\n  throw new Error('options.meta must be provided as a function');\n}","typeGuard":"function hasMeta(o) {\n  return typeof o?.meta === 'function';\n}","tryCatchPattern":"try {\n  await registerInterface(options);\n} catch (e) {\n  if (e.message === 'options.meta must be a function') {\n    console.error('Provide meta: async (context, query) => compilerApi.meta(context, query).');\n  } else throw e;\n}","preventionTips":["Pass the existing compilerApi/orchestrator meta handler rather than writing a new one.","Beware of passing meta as an invoked result or object; always pass the function reference.","Validate the complete options bag with a helper covering all required callbacks."],"tags":["validation","callback","metadata","sql-interface"],"backgroundTag":"missing-required-callback","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}