{"record":{"id":"701774098ceeea12","repo":"cube-js/cube","slug":"parameter-with-type-typeof-parameter-is-not-su","errorCode":null,"errorMessage":"Parameter with type: ${typeof parameter} is not supported","messagePattern":"Parameter with type: (.+?) is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-cubestore-driver/src/WebSocketConnection.ts","lineNumber":531,"sourceCode":"            builder,\n            HttpParameterValue.Float64Value,\n            httpParameterValueOffset\n          );\n        }\n      }\n      case 'string':\n      {\n        const valueOffset = builder.createString(parameter);\n        const httpParameterValueOffset = StringValue.createStringValue(builder, valueOffset);\n\n        return HttpParameter.createHttpParameter(\n          builder,\n          HttpParameterValue.StringValue,\n          httpParameterValueOffset\n        );\n      }\n      default:\n        throw new Error(`Parameter with type: ${typeof parameter} is not supported`);\n    }\n  }\n\n  public async query(query: string, parameters: QueryParameter[], options: WebSocketQueryOptions): Promise<any[]> {\n    const { inlineTables, queryTracingObj, responseFormat } = options;\n\n    const builder = new flatbuffers.Builder(1024);\n    const queryOffset = builder.createString(query);\n\n    let traceObjOffset: number | null = null;\n    if (queryTracingObj) {\n      traceObjOffset = builder.createString(JSON.stringify(queryTracingObj));\n    }\n\n    let inlineTablesOffset: number | null = null;\n    if (inlineTables && inlineTables.length > 0) {\n      const inlineTableOffsets: number[] = [];\n      for (const table of inlineTables) {","sourceCodeStart":513,"sourceCodeEnd":549,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-cubestore-driver/src/WebSocketConnection.ts#L513-L549","documentation":"serializeParameter's default case rejects any parameter whose typeof is not one of the supported wire types (string, number, boolean, binary/object-with-binary handling). The message reports the offending typeof so callers can find the bad parameter.","triggerScenarios":"Passing undefined, null, symbol, function, bigint, or other unsupported-typed values as a query parameter to query().","commonSituations":"undefined leaked from unassigned variables in template-built params; null filtering conditions; functions passed by mistake; bigint values from ID libraries.","solutions":["Log and inspect the parameters array to find the offending value","Convert null explicitly or filter unsupported placeholders","Convert bigint to string; replace functions/undefined with real values","Add a parameter whitelist check before calling query()"],"exampleFix":"// before\ndriver.query('SELECT * FROM t WHERE a = ?', [maybeUndefined]);\n// after\ndriver.query('SELECT * FROM t WHERE a = ?', [maybeUndefined ?? null]);\n// or validate\nparams.forEach(p => {\n  if (!['string','number','boolean'].includes(typeof p)) throw new Error('bad param');\n});","handlingStrategy":"type-guard","validationCode":"function filterParams(params) {\n  return params.map(p => {\n    if (p === undefined) return null;\n    if (typeof p === 'bigint') return p.toString();\n    if (typeof p === 'function' || typeof p === 'symbol') {\n      throw new Error('unsupported parameter type');\n    }\n    return p;\n  });\n}","typeGuard":"const isSupportedParam = (p) =>\n  ['string', 'number', 'boolean'].includes(typeof p) || p === null || isBinaryParam(p);","tryCatchPattern":"try {\n  return await driver.query(sql, params);\n} catch (e) {\n  const m = /Parameter with type: (\\w+) is not supported/.exec(e.message);\n  if (m) {\n    console.error('Bad query parameter at:', params.map(p => typeof p));\n    return driver.query(sql, coerceParams(params));\n  }\n  throw e;\n}","preventionTips":["Default undefined/null params explicitly when building parameter arrays","Convert bigint IDs to strings before passing","Validate typeof of every param in a shared query helper","Avoid dynamic code paths that can inject functions/symbols into params"],"tags":["cubestore","parameters","type-error"],"backgroundTag":"unsupported-parameter-type","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}